A project ID is required for some requests when an API is called. Therefore, obtain the project ID before calling the API. Use either of the following methods:
To do so, perform the following operations:
The API for obtaining a project ID is GET https://{iam-endpoint}/v3/projects. To obtain {iam-endpoint}, see Request URIEndpoints.
The following is an example response. For example, if ModelArts is deployed in the xxx region, the value of name in the response body is xxx. The value of id in projects is the project ID.
{ "projects": [{ "domain_id": "65382450e8f64ac0870cd180d14e684b", "is_domain": false, "parent_id": "65382450e8f64ac0870cd180d14e684b", "name": "xxx", "description": "", "links": { "next": null, "previous": null, "self": "https://www.example.com/v3/projects/a4a5d4098fb4474fa22cd05f897d6b99" }, "id": "a4a5d4098fb4474fa22cd05f897d6b99", "enabled": true }], "links": { "next": null, "previous": null, "self": "https://www.example.com/v3/projects" } }