Help Center> Cloud Trace Service> API Reference> Appendix> Obtaining the Account ID and Project ID

Obtaining the Account ID and Project ID

Obtaining Account and Project IDs from the Console

Account and project IDs are required for some URLs when an API is called. You can perform the following operations to obtain the IDs:

  1. Log in to the management console.

  2. Click the username and select My Credentials from the drop-down list.

  3. On the My Credentials page, view the account and project IDs.

If there are multiple projects in one region, expand Region and obtain sub-project IDs from the Project ID column.

Obtaining the Project ID by Calling an API

The API for obtaining the project ID is GET https://{Endpoint}/v3/projects/. {Endpoint} indicates the endpoint of IAM (Identity and Access Management).

The following is an example response. The value of id in the projects field is the project ID.

{
    "projects": [
        {
            "domain_id": "65382450e8f64ac0870cd180d14e684b",
            "is_domain": false,
            "parent_id": "65382450e8f64ac0870cd180d14e684b",
            "name": "cn-north-4",
            "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"
    }
}