更新时间:2025-06-30 GMT+08:00
获取账号ID和项目ID
从控制台获取账号ID和项目ID
在调用接口的时候,部分URL中需要填入账号ID(domain-id)和项目ID,您可以通过控制台获取这些参数,步骤如下:
多项目时,展开“所属区域”,从“项目ID”列获取子项目ID。
调用API获取项目ID
获取项目ID的接口为“GET https://{Endpoint}/v3/projects”,其中{Endpoint}为IAM的终端节点。
响应示例如下,其中projects下的“id”即为项目ID。
{
"projects": [
{
"domain_id": "65382450e8f64ac0870cd180xxxx",
"is_domain": false,
"parent_id": "65382450e8f64ac0870cd180d1xxxx",
"name": "xx-region-1",
"description": "",
"links": {
"next": null,
"previous": null,
"self": "https://www.example.com/v3/projects/a4a5d4098fb4474fa22cd05f89xxxx"
},
"id": "a4a5d4098fb4474fa22cd0xxxx",
"enabled": true
}
],
"links": {
"next": null,
"previous": null,
"self": "https://www.example.com/v3/projects"
}
}

