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

Obtaining a Project ID

Obtaining a Project ID on the Console

A project ID needs to be specified in the URI or request body for calling certain API. To obtain a project ID, perform the following procedure:

  1. On the Huawei Cloud homepage, click Console in the upper right corner.
  2. Hover over the username in the upper right corner and choose My Credentials.

  3. On the My Credentials page, choose API Credentials to view the project ID.
    Figure 1 API credentials - obtaining a project ID

Obtaining a Project ID by Calling an API

You can obtain a project ID by calling the API Querying Project Information.

The API for obtaining a project ID is GET https://{Endpoint}/v3/projects/. {Endpoint} indicates the endpoint of IAM, which can be obtained from Platform Connection Information. For details about API authentication, see Authentication.

In the following example, id indicates a project ID.

{ 
    "projects": [ 
        { 
            "domain_id": "65382450e8f64ac0870cd180d...", 
            "is_domain": false, 
            "parent_id": "65382450e8f64ac0870cd180d1...", 
            "name": "cn-north-4", 
            "description": "", 
            "links": { 
                "next": null, 
                "previous": null, 
                "self": "https://www.example.com/v3/projects/a4a5d4098fb4474fa22cd0..." 
            }, 
            "id": "a4a5d4098fb4474fa22cd05f897xxxx", 
            "enabled": true 
        } 
    ], 
    "links": { 
        "next": null, 
        "previous": null, 
        "self": "https://www.example.com/v3/projects" 
    } 
}