Updated on 2024-12-30 GMT+08:00

Response

Status Code

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

A status code is a group of digits, ranging from 1xx to 5xx. It indicates the status of a request.

For example, if status code 200 is returned for calling the API used to obtain an access credential, the request is successful.

(Optional) Response Header

This part is optional.

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

The API used to obtain an access token does not return a response header.

(Optional) Response Body

This part is optional. The body of a response is often returned 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 part of the response body for the API used to obtain an access token.

{
  "access_token" : "334*********************************140...",
  "expires_in" : 1719,
  "refresh_token":"42e******************w24...",
  "token_type" : "Bearer",
  "scope" : "get_user_info",
}
If an error occurs during API calling, an error code and a message will be displayed. The following shows an error response body.
{
  "error": "invalid_client",
  "error_description": "Invalid authorization code"
}

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