Skip to main content

Login

Goodwill Login Flow

#REQUESTRESPONSE
1https://api.gwcindia.in/v1/login?api_key=xxxRedirects Goodwill Login page
2After Successful Goodwill Loginrequest_token will be passed as query string parameter to the registered redirect URL.
3https://api.gwcindia.in/v1/login-response with SignatureUser Login Session Details

Login Response

Rest PropertiesDescription
NameLogin Response
DescriptionGives the login session details with access token
URLhttps://api.gwcindia.in/v1/login-response
InputYES

Input

#ParameterDescription
1api_keyAPI Key
2request_tokenReceived as Query String to the Redirect URL
3signatureHash value using request_token as key

SUCCESSFUL RESPONSE

#ParameterDescription
1client_idClient Unique ID
2nameAccount name
3emailEmail id of user
4exarrEnabled exchange in a JSON array
5prarrEnabled product type in a JSON array
6orarrEnabled order type in a JSON array
7exchDetailExchange details JSON object
8usersessionidUser session ID (Used in web sockets)
9access_tokenAccess Token

ERROR RESPONSE

#ParameterDescription
1statuserror
2error_msgError Message
3error_typeError Type
#Error MessagesDescription
1Invalid API key or API key expiredInput API Key is invalid or expired
2Invalid SignatureInput Signature is invalid
3Invalid Request TokenInput Session ID and Request Token is Invalid

Signature

To make the request secure, we have implemented parameter posting with signature (i.e. SHA-256 of checksum). The signature parameter is created by hashing the values of the following parameters:

  1. API Key
  2. request_token
  3. API Secret

checksum = API Key + request_token + API Secret
signature = SHA-256 of checksum

The signature parameter is mandatory and needs to be added in login-response API.

Example
https://{{registered redirect URL}}?request_token={{request_token}}
Input Request
{
"api_key": "xxxxx",
"request_token": "5ca9e0b42c4e94759030e850",
"signature": "f110112a934b7a867dfe611abb41b7274e"
}
Success Response Body
{
"status": "success",
"data": {
"clnt_id": "GQ1A0007",
"name": "MANOHARAN SARAVANABHAVAN",
"email": "SARAVANAKIRAN2012@GMAIL.COM",
"exarr": ["BSE", "NFO", "NSE", "MCX", "ICEX"],
"prarr": ["BO", "CNC", "CO", "MIS", "NRML"],
"orarr": ["L", "MKT", "SL", "SL-M"],
"exchDetail": {
"EQUITY": [
{
"product": ["BO", "CNC", "CO", "MIS", "NRML"],
"exchseg": "bse_cm",
"exch": "BSE"
},
{
"product": ["BO", "CNC", "CO", "MIS", "NRML"],
"exchseg": "nse_cm",
"exch": "NSE"
}
],
"DERIVATIVE": [
{
"product": ["BO", "CO", "MIS", "NRML"],
"exchseg": "nse_fo",
"exch": "NFO"
}
],
"COMMODITY": [
{
"product": ["BO", "CO", "MIS", "NRML"],
"exchseg": "mcx_fo",
"exch": "MCX"
},
{
"product": ["BO", "CO", "MIS", "NRML"],
"exchseg": "icx_fo",
"exch": "ICEX"
}
]
},
"usersessionid": "3279379865",
"access_token": "8a5e32e1126025fefbcefc88eb6eb9a9"
}
}
Error Response Body
{
"status": "error",
"error_msg": "Invalid Signature",
"error_type": "E"
}
Example:

API Key = "xxxxx"
request_token = "5ca9e0b42c4e94759030e850"
API Secret = "yyyyy"

checksum = 'xxxxx5ca9e0b42c4e94759030e850yyyyy'
signature = hash('sha256', 'xxxxx5ca9e0b42c4e94759030e850yyyyy')