Access Token

POSTJSONRest API
158278

Daily API Calls

100%

Success Rate

143ms

Avg. Response Time


The API is designed to generate access token for a client with help of Request Token obtained from either TOTP or OAUTH Login. 

To generate the access token, partner/client needs to provide AppKey in the head of the payload whereas UserID and encryptionKey needs to be passed in body. The successful API call will provide the partner a Access token which is valid throughout a day. This access token can be used to call all further API's.

REQUEST URL

https://Openapi.5paisa.com/VendorsAPI/Service1.svc/GetAccessToken

Headers

KEYVALUE

Content-Type

application/json

Request body

FIELD NAMEMANDATORYDESCRIPTION

head

key

STRING

Yes

AppKey of user or partner

body

requestToken

STRING

Yes

This is the token received after logging in through TOTP or OAUTH.

EncryKey

STRING

Yes

Encryption Key of the User or Partner received along with API credentials.

userID

STRING

Yes

Encryption Key of the User or Partner received along with API credentials.

Access Token - FAQ

The EncrypKey and UserId correspond to the partner when the client logs in through a partner and to the client when the client logs in independently.

Client keys can be find here  

After successful login Partner will receive client code in response.

SAMPLE REQUEST BODY  :

{
    "head": {
        "Key": "{{Partner/User App key}}"
    },
    "body": {
        "RequestToken": "{{request_token}}",
        "EncryKey": "{{Parter/User_encrykey}}",
        "UserId": "{{Parter/User_userid}}"
    }
}

Validity of Access Token

The access token  generated after successful login request remains valid thought a day from the time of its generation. Token expires every day at 11:59 PM.

Response body

FIELD NAMEVALUESDESCRIPTION

body

AccessToken

STRING

 

 

-

This is the access token(JWT) after successful user login. 

ClientCode

STRING

50012322

The client code of the logged in user.

ClientName

STRING

Mahendra

The client Name of the logged in user.

POAStatus

STRING

Y/N

The Power of attorney status of the logged in user.

ClientType

STRING

1

The client type of the logged in user.

CustomerType

STRING

BASIC

Subscription Plan client has subscribed to. 

AllowBseCash

STRING

Y/N

Segment Activation Flags, please find the list below.

StatusDescription

STRING

0: Success

2: Invalid Inputs

It is the description of the status of the API request.

Status

INTEGER

0

2

It is numeric code for the status of the API request.

Segment Activation Flags

AllowBseCash,AllowBseDeriv,AllowBseMF,AllowMCXComm,AllowMcxSx,AllowNSECurrency,AllowNSEL,AllowNseCash,AllowNseComm,AllowNseDeriv,AllowNseMF,CommodityEnabled

 SAMPLE SUCCESS RESPONSE  

{
   "body": {
       "AccessToken": "{{Access_Token}}",
       "AllowBseCash": "Y",
       "AllowBseDeriv": "Y",
       "AllowBseMF": "Y",
       "AllowMCXComm": "Y",
       "AllowMcxSx": "N",
       "AllowNSECurrency": "Y",
       "AllowNSEL": "Y",
       "AllowNseCash": "Y",
       "AllowNseComm": "N",
       "AllowNseDeriv": "Y",
       "AllowNseMF": "N",
       "BulkOrderAllowed": 0,
       "CleareDt": "/Date(1715225400000+0530)/",
       "ClientCode": "{clientCode}",
       "ClientName": "{client_name}",
       "ClientType": "1",
       "CommodityEnabled": "Y",
       "CustomerType": "BASIC",
       "DPInfoAvailable": "Y",
       "DemoTrial": "N",
       "DirectMFCharges": 10,
       "IsIDBound": 0,
       "IsIDBound2": 0,
       "IsOnlyMF": "N",
       "IsPLM": 0,
       "IsPLMDefined": 0,
       "Message": "Success",
       "OTPCredentialID": "",
       "PGCharges": 10,
       "PLMsAllowed": 0,
       "POAStatus": "Y",
       "PasswordChangeFlag": 0,
       "PasswordChangeMessage": "",
       "ReferralBenefits": 250,
       "RefreshToken": "{refresh_token}",
       "RunningAuthorization": 0,
       "Status": 0,
       "VersionChanged": 0
   },
   "head": {
       "Status": 0,
       "StatusDescription": "Success"
   }
}

 SAMPLE FAILURE RESPONSE:  Failure due to wrong Expired API credentials or request code in the head

{
   "body": {
       "AccessToken": "",
       "AllowBseCash": "",
       "AllowBseDeriv": "",
       "AllowBseMF": "",
       "AllowMCXComm": "",
       "AllowMcxSx": "",
       "AllowNSECurrency": "",
       "AllowNSEL": "",
       "AllowNseCash": "",
       "AllowNseComm": "",
       "AllowNseDeriv": "",
       "AllowNseMF": "",
       "BulkOrderAllowed": 0,
       "CleareDt": "/Date(1715580830932+0530)/",
       "ClientCode": "",
       "ClientName": "",
       "ClientType": "",
       "CommodityEnabled": "",
       "CustomerType": "",
       "DPInfoAvailable": "",
       "DemoTrial": "",
       "DirectMFCharges": 0,
       "IsIDBound": 0,
       "IsIDBound2": 0,
       "IsOnlyMF": "",
       "IsPLM": 0,
       "IsPLMDefined": 0,
       "Message": "Token Expired.",
       "OTPCredentialID": "",
       "PGCharges": 0,
       "PLMsAllowed": 0,
       "POAStatus":"

 SAMPLE FAILURE RESPONSE:  Failure due to invalid resquest token

{
   "body": {
       "AccessToken": "",
       "AllowBseCash": "",
       "AllowBseDeriv": "",
       "AllowBseMF": "",
       "AllowMCXComm": "",
       "AllowMcxSx": "",
       "AllowNSECurrency": "",
       "AllowNSEL": "",
       "AllowNseCash": "",
       "AllowNseComm": "",
       "AllowNseDeriv": "",
       "AllowNseMF": "",
       "BulkOrderAllowed": 0,
       "CleareDt": "/Date(1715258267376+0530)/",
       "ClientCode": "",
       "ClientName": "",
       "ClientType": "",
       "CommodityEnabled": "",
       "CustomerType": "",
       "DPInfoAvailable": "",
       "DemoTrial": "",
       "DirectMFCharges": 0,
       "IsIDBound": 0,
       "IsIDBound2": 0,
       "IsOnlyMF": "",
       "IsPLM": 0,
       "IsPLMDefined": 0,
       "Message": "Server Unable to process your request",
       "OTPCredentialID": "",
       "PGCharges": 0,
       "PLMsAllowed": 0,
       "POAStatus":"

On this Page

Knowledge base

Login check API docs is the next thing to checkout
Login Check API
How to use this API that suits your work flow best
Start using our APIs

Contribute and get rewarded

Help make these Dev Docs great, contribute to the APIs and get rewarded for your contribution

Need Help

Ask Developer Community

Contact Support

 

Changelog

Changes made to our APIs - Changelog

AVENUES