Updated on 2025-08-14 GMT+08:00

Response

After sending a request, you will receive a response, including a status code, response header, and response body.

Status Code

A status code is a group of digits ranging from 2xx (indicating successes) to 4xx or 5xx (indicating errors). It indicates the status of a response. For more information, see Status Codes.

If status code 200 is returned for calling the API for obtaining access token in OAuth 2.0 client authentication mode, the request is successful.

Response Header

Similar to a request, a response also has a header, for example, Content-Type.

The following is a part of the response header for the API for obtaining a user token by using OAuth 2.0 client credentials.

Figure 1 Response Headers

(Optional) Response Body

The body of a response is often sent in a structured format (for example, JSON or XML) as specified in the Content-Type header field. The response body transfers content except the response header.

The following is a part of the response body for the API for obtaining a user access token by using OAuth 2.0 client credentials. access_token indicates the user token to be obtained, and its value is represented by variable XXX. access_token can then be used to authenticate the calling of other APIs.

{
    "access_token": "XXX",
    "expires_in": 600,
    "token_type": "Bearer"
}

If an error occurs during API calling, the error code 400 and its message will be displayed. The following shows an error response body.

{
    "error": "unauthorized_client",
    "error_description": "The client is not authorized to request a token using this method."
}

In the response body, error is an error type, and error_description provides information about the error.