Authentication
To invoke any API call, you must have a valid Access Token generated using the valid application credentials.
To generate the token using the appId
and appSecret
, the HTTP POST request needs to be made with these details.
JavaScript code to generate the Access Token. The code should work with Node.js 7+ and browsers. You will need to install request for this sample code.
$ npm i request
If you don't already have your app id or app secret, log in to the platform to get your credentials.
info
Make sure that you replace appId and appSecret placeholders with the real values before you execute the code.
- CURL
- Javascript
For a valid appId
and appSecret
combination, the success response will be returned like this.
accessToken
- Token to be used for authorization in X-API-KEY header.
expiresIn
- Duration in seconds after which the accessToken expires.
For any invalid appId
and appSecret
combination, HTTP 401 Unauthorized
response code will be returned.