Obtaining the Identity Information of a Caller
Function
This API is used to obtain the identity information of a caller (such as a user or agency).
Authorization Information
No identity policy-based permission required for calling this API.
URI
GET /v5/caller-identity
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| X-Security-Token | No | String | Definition: security_token field of a temporary security credential. Constraints: When an API is called using a temporary security credential, the HTTP header X-Security-Token must be provided. Range: N/A Default Value: N/A |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| account_id | String | Definition: Account ID. Range: N/A |
| principal_urn | String | Definition : Uniform Resource Name (URN). For details, see Reference. Range: N/A. |
| principal_id | String | Definition: Principal ID. Range: N/A |
Status code: 500
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Definition : Error code. For details, see Error Code. Range: The format is STS5.XXXX, for example, STS5.1001. |
| error_msg | String | Definition : Error message. For details, see Error Message. Range: N/A. |
Example Requests
Obtaining the identity information of a caller
GET https://{endpoint}/v5/caller-identity Example Responses
Status code: 200
Successful
{
"account_id" : "27680d67da6b47eb82d00a1a118be145",
"principal_urn" : "iam::27680d67da6b47eb82d00a1a118be145:user:user-name",
"principal_id" : "user-id"
} Status Codes
| Status Code | Description |
|---|---|
| 200 | Successful |
| 500 | Server error |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot