...

  • expires_in specifies the number of seconds remaining for the access_token to expire.

  • You should use the access_token as the Bearer token header for accessing any resource.

    • Header Name - Authorization

    • Header Value - Bearer 2c7c0f10-adf5-ed55-a931-caeea29464ee

  • You should use the refresh_token in order to get a new access_token once it is expired

3. Refresh Token

<ToDo>You would need to call this API for getting a new access_token if it expired. Your application should ideally store the refresh_token generated previously (ex. database). Use the refresh_token to retrieve a new access_token.

Of course, you should pass client_id and client_secret similar to the previous request.

Status
colourYellow
titleENDPOINT Url
POST /api/v1/oauth/token

Query Parameters

Name

Type

Description

client_id

string

Required. The client ID you received from Citesphere for your App.

client_secret

string

Required. The client secret you received from Citesphere for your App.

refresh_token

string

Required. Use the refresh_token you got from the previous step.

Example: 0d06219a-1b49-7895-9220-ef3b9810f09d

grant_type

string

Required. Use refresh_token in this scenario

Example: POST /api/v1/oauth/token?client_id=OAUTHCLIENT007&client_secret=xyz&refresh_token=0d06219a-1b49-7895-9220-ef3b9810f09d&grant_type=refresh_token

Response

Code Block
languagejson
{
    "access_token": "c322172e-16ac-8952-95e7-19639745bbaf",
    "token_type": "bearer",
    "refresh_token": "0d06219a-1b49-7895-9220-ef3b9810f09d",
    "expires_in": 3600,
    "scope": "read"
}

You can use the newly generated access_token for accessing resources.