Generating an OAuth Token

Follow the steps to generate an OAuth token:

  1. Go to API Keys under your account name on the upper right corner, and obtain your API Key and Secret from the webpage, as shown in the image below:

    Note: Upon obtaining your credentials (API Key and Secret), you can use the credentials to generate an OAuth token and pass the token in SDK and REST implementation to get the access.
  2. To generate the OAuth Token, encode your credentials (API Key and Secret) using base64 computation mechanism. To do this, provide your API key and Secret to the base64 encoder (online encoder can be used), and 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.

    Note: In case of Maps; refer Making Maps API Call
  3. Enter the generated 'base64value' in the header and request body and call the token URI as shown below:
    Header
    Authorization Basic {base64Value}
    Content-Type application/x-www-form-urlencoded
    Request Body
    grant_type=client_credentials
  4. The access token is returned as follows:
    Note: The expiresIn time is in seconds.
    {
    "access_token": "{YOUR ACCESS TOKEN}"
    "tokenType": "BearerToken",
    "issuedAt": "1429188455329",
    "expiresIn": "35999",
    "clientID": "{YOUR API KEY}",
    "org": "api.precisely.com"
    }
  5. You can pass the token in SDK and REST implementations. The details can be found at Making an API Call.