GET api/v{version}/token/{grantType}/{code}
Obtain an access token using your initial API code (grantType=code) or refresh token (grantType=refresh).
Request Information
URI Parameters
| Name | Description | Type | Additional information |
|---|---|---|---|
| grantType |
Type of the grant (code or refresh). |
string |
Required |
| code |
The code. |
string |
Required |
| version | string |
None. |
Body Parameters
None.
Response Information
Resource Description
ResponseOfTokenResponse| Name | Description | Type | Additional information |
|---|---|---|---|
| Data | TokenResponse |
None. |
|
| StatusCode |
Gets or sets the status code. |
HttpStatusCode |
None. |
| StatusDescription |
Gets or sets the status description. |
string |
None. |
| Errors | Collection of string |
None. |
Response Formats
application/json, text/json
Sample:
{
"data": {
"accessToken": "sample string 1",
"refreshToken": "sample string 2",
"type": "sample string 3",
"expires": "2025-11-03T04:08:50.9406975-07:00"
},
"statusCode": 100,
"statusDescription": "sample string 1",
"errors": [
"sample string 1",
"sample string 2"
]
}
application/xml, text/xml
Sample:
<ResponseOfTokenResponsem8NcPL_PI xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CancerBytesAPI.Response">
<Errors xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:string>sample string 1</d2p1:string>
<d2p1:string>sample string 2</d2p1:string>
</Errors>
<StatusCode>Continue</StatusCode>
<StatusDescription>sample string 1</StatusDescription>
<Data>
<AccessToken>sample string 1</AccessToken>
<Expires>2025-11-03T04:08:50.9406975-07:00</Expires>
<RefreshToken>sample string 2</RefreshToken>
<Type>sample string 3</Type>
</Data>
</ResponseOfTokenResponsem8NcPL_PI>