Updated on 2025-11-06 GMT+08:00

Response

Status Code

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

Status code is a group of digits ranging from 1xx to 5xx. It indicates the status of a response. For more information, see Status Codes.

For example, if status code 200 is returned for calling the API used to obtain a temporary security credential through an agency or trust agency, the request is successful.

Response Header

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

For the API used to obtain a temporary security credential through an agency or trust agency, Figure 1 is the desired response header.

Figure 1 Response header for obtaining a temporary security credential through an agency or trust agency

Response Body

The body of a response is often returned in structured format 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 a temporary security credential through an agency or trust agency.

{
    "source_identity": "{source_identity}",
    "assumed_agency": {
        "urn": "sts::{account_id}::assumed-agency:{agency_name}/{agency_session_name}",
        "id": "{agency_id}:{agency_session_name}"
    },
    "credentials": {
	"access_key_id":"HSTANOXZU2UXBS55JLJ3",
	"secret_access_key":"EoWCQrr...SCcw4Whkt2aXKWAr",
	"security_token":"hQpjbi1XXXXXX...XXXXXbhBbA0TQ==",
	"expiration":"2022-09-07T03:27:51.158Z"
    }
}

If an error occurs during API calling, an error code and error message will be displayed. The following example is an error response body:

{
    "error_code": "STS5.1106",
    "error_msg": "the agency 'iam::{account_id}:agency:{agency_name}' cannot be found"
}

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