Get an Access Token
Obtains an access token that grants access to the NovoOne API.
Request URL
POST {base_url}/api/v1/oauth2/token
Request parameters
- Body parameters
-
Parameter Required Type Description grant_type Yes String The authorization mode.
Valid value:
openapi: Mode used to retrieve the access token for third-party platform API requests.
client_id Yes String Client ID. Note: You can obtain the Client ID from the NovoOne Platform portal (Path: ).client_secret Yes String Client secret. Note: You can obtain the Client secret from the NovoOne Platform portal (Path: ).
Response parameters
| Parameter | Type | Description |
|---|---|---|
| requestId | String | The unique ID of the request, which can be used to quickly locate the request. |
| code | String | The HTTP status code of the request.
|
| message | String | The status message of the request. |
| detailMessage | String | The detailed error information. When the request is successful, this parameter returns empty. |
| result | Object<Access_Token> | The information of the access token. |
- Access_Token
-
Parameter Type Description access_token String The token that can be used to access NovoOne API.
token_type String The type of the access token. Bearer
expires_in Integer The remaining lifetime of the access token in seconds.
Example
Request
example
POST /api/v1/oauth2/token HTTP/1.1 Host: api.cn.novoone.com Content-Type: application/x-www-form-urlencoded grant_type=openapi&client_id=slNvt3hw55pvVnGFSaGfNU3f1lXCyikO&client_secret=p5osWiBS2AFN49XDB1yR9wSd94DpR61h
Response example
{
"result": {
"access_token": "eyJraWQiOiJjbi0wLWtleS0xIiwiYWxnIjoiUlMyNTYifQ.eyJ...",
"token_type": "Bearer",
"expires_in": 21599
},
"requestId": "c9c1ca8051b45e6ef7629b2e6c17ea60",
"code": "200",
"message": "SUCCESS"
}
Note: The value of
access_token shown above is abbreviated.