Generating OAuth Token Manually
After obtaining your credentials (API Key and Secret), you can use the credentials to generate an OAuth token manually and pass the token in any specific API available in Node.js SDK.
The steps below explain (with API examples) how to generate the token and pass it in the API method:
- Encode your credentials using base64 computation mechanism. To do this, provide your
API key and Secret to the base64 encoder (online encoder can be
used), to generate the encoded 'base64value'.
The following format is to be used while computing the {BASE64VALUE}:
{YOUR API KEY}:{YOUR SECRET}
where,
{YOUR API KEY} = API Key obtained from developer's site.
{YOUR SECRET} = Secret obtained from developer's site.
- To generate the OAuth token, enter the generated 'base64value' in the header and
request body and call the token URI. See the example below:
Authorization: Basic {base64Value} Content-Type: application/x-www-form-urlencoded POST https://api.precisely.com/oauth/token grant_type=client_credentials
- The OAuth token is returned as:
{"access_token":"{your access token}" .............}