OAuth Token
Represents an OAuth 2.0 Access or Refresh Token
The OAuth Token object
Attributes
Name | Type | Description |
---|---|---|
access_token |
String | The Access Token ID |
expires_in |
int | The number of seconds until this access token expires |
refresh_token |
string | If provided, a valid Refresh Token that can be exchanged later for another Access Token when this one expires |
token_type |
string | What type of Access Token this is (currently only Bearer is supported) |
Available APIs
POST /oauth/token
Exchange an authorization code (returned from the Authentication Process) for an Access Token
Request Properties
Name | Type | Description |
---|---|---|
grant_type |
String | Required The type of token we’ll be granting (authorization_code or refresh_token ) |
client_id |
UUID | Required The application ID provided to you by UniKey |
client_secret |
String | Required The application secret provided to you by UniKey |
code |
String | Required The authorization_code you received from Step 1 |
Response Properties
Returns an OAuth Token object
Authorization Code Exchange Example Request
POST /oauth/token
{
"grant_type": "authorization_code",
"client_id": "64f7eb41-9327-4f30-95ce-2f7b657f303f",
"client_secret": "JGK8nKW7Ncz8dhalskdgCxTZ4MVJUmF8YwLka0jieRds6tp01yV1qvv0Zc9/xj/2KIkn7ZIMZZeaDB0WlDA==",
"code": "0a2b4e1b-29bd-4962-93e6-961acee849b0"
}
Authorization Code Exchange Example Response
HTTP/1.1 200 OK
{
"access_token": "95ac4fc1-a753-4d9b-822c-c1a312e1f28f",
"expires_in": 5184000,
"refresh_token": "fb75325a-2ce3-4563-83dc-ebd2f3b9ff8a",
"token_type": "bearer"
}
Refresh Token Exchange Example Request
POST /oauth/token
{
"grant_type": "refresh_token",
"client_id": "64f7eb41-9327-4f30-95ce-2f7b657f303f",
"client_secret": "JGK8nKW7Ncz8dhalskdgCxTZ4MVJUmF8YwLka0jieRds6tp01yV1qvv0Zc9/xj/2KIkn7ZIMZZeaDB0WlDA==",
"refresh_token": "0a2b4e1b-29bd-4962-93e6-961acee849b0"
}
Refresh Token Exchange Example Response
HTTP/1.1 200 OK
{
"access_token": "b7e9298c-c4b8-4402-b5b1-45625248084d",
"expires_in": 5184000,
"refresh_token": "70a662dd-57a5-4c58-b7da-967bd0aac0c7",
"token_type": "bearer"
}