Updated on 2024-04-10 GMT+08:00

Obtaining Agency Credentials

Function

This API is used to obtain the STS short-term credentials for the agency or trust agency assigned to a user.

URI

GET /v1/credentials

Table 1 Query parameters

Parameter

Mandatory

Type

Description

target_account_id

Yes

String

Globally unique ID of the target account

agency_urn

Yes

String

Uniform Resource Name (URN) of an agency or trust agency

Request Parameters

Table 2 Parameters in the request header

Parameter

Mandatory

Type

Description

access-token

Yes

String

Access token issued by the creating token API

Maximum length: 4096

Response Parameters

Status code: 200

Table 3 Parameters in the response body

Parameter

Type

Description

agency_credentials

Object

Credential of an agency or trust agency assigned to a user

Table 4 agency_credentials

Parameter

Type

Description

access_key_id

String

ID of a temporary security credential

expiration

Long

Expiration time of the temporary security credential

secret_access_key

String

Secret key used to sign requests

session_token

String

Temporary credential token

Example Request

Obtaining the STS short-term credentials for the agency or trust agency assigned to a user

GET https://{hostname}/v1/credentials

Example Response

Status code: 200

Successful

{
  "agency_credentials" : {
    "access_key_id" : "example-access-key-id",
    "expiration" : 1684955360,
    "secret_access_key" : "example-secret-access-key",
    "session_token" : "string"
  }
}

Status Codes

For details, see Status Codes.

Error Codes

For details, see Error Codes.