To invoke any API call, you must have a valid Access Token generated using the valid application credentials.
To generate the token using the
appSecret, the HTTP POST request needs to be made with these details.
$ npm i request
If you don't already have your app id or app secret, log in to the platform to get your credentials.
Make sure that you replace appId and appSecret placeholders with the real values before you execute the code.
For a valid
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
appSecret combination, HTTP
401 Unauthorized response code will be returned.