Files
doc-exports/docs/ucs/api-ref/ucs_api_0018.html
qiujiandong1 535e30e292 UCS API initial update 20250523 version
Reviewed-by: Gergo-Bence Lorincz <a200452876@noreply.gitea.eco.tsi-dev.otc-service.com>
Co-authored-by: qiujiandong1 <qiujiandong1@huawei.com>
Co-committed-by: qiujiandong1 <qiujiandong1@huawei.com>
2026-02-23 09:12:31 +00:00

47 lines
4.6 KiB
HTML

<a name="ucs_api_0018"></a><a name="ucs_api_0018"></a>
<h1 class="topictitle1">Obtaining a Project ID</h1>
<div id="body0000001456493762"><div class="section" id="ucs_api_0018__en-us_topic_0121673684_section1876711368114"><h4 class="sectiontitle">Scenarios</h4><p id="ucs_api_0018__en-us_topic_0121673684_p177063681115">A project ID is required for some URLs when an API is called. Therefore, you need to obtain a project ID in advance. Two methods are available:</p>
<ul id="ucs_api_0018__en-us_topic_0121673684_ul2770123611111"><li id="ucs_api_0018__en-us_topic_0121673684_li157701436141116"><a href="#ucs_api_0018__en-us_topic_0121673684_section86806471133">Call an API</a>.</li><li id="ucs_api_0018__en-us_topic_0121673684_li07701836121118"><a href="#ucs_api_0018__en-us_topic_0121673684_section32975495318">Use the console</a>.</li></ul>
</div>
<div class="section" id="ucs_api_0018__en-us_topic_0121673684_section86806471133"><a name="ucs_api_0018__en-us_topic_0121673684_section86806471133"></a><a name="en-us_topic_0121673684_section86806471133"></a><h4 class="sectiontitle">Obtaining a Project ID by Calling an API</h4><p id="ucs_api_0018__en-us_topic_0121673684_p31183326524">You can obtain the project ID by calling the IAM API used to query project information based on the specified criteria.</p>
<p id="ucs_api_0018__en-us_topic_0121673684_p857314915139">The API used to obtain a project ID is <strong id="ucs_api_0018__b043455711102">GET https://</strong><em id="ucs_api_0018__i47262118104">{Endpoint}</em><strong id="ucs_api_0018__b173264431110">/v3/projects</strong>. <em id="ucs_api_0018__i1891111163109">{Endpoint}</em> is the IAM endpoint and can be obtained from the administrator<a href="https://docs.otc.t-systems.com/en-us/additional/endpoints.html" target="_blank" rel="noopener noreferrer">Regions and Endpoints</a>. For details about API authentication, see <a href="ucs_api_0009.html">Authentication</a>.</p>
<p id="ucs_api_0018__en-us_topic_0121673684_p3770181514218">The following is an example response. The value of <strong id="ucs_api_0018__en-us_topic_0121673684_b842352706123544">id</strong> is the project ID.</p>
<pre class="screen" id="ucs_api_0018__en-us_topic_0121673684_screen14199113161316">{
"projects": [
{
"domain_id": "65382450e8f64ac0870cd180d14e684b",
"is_domain": false,
"parent_id": "65382450e8f64ac0870cd180d14e684b",
"name": "project_name",
"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"
}
}</pre>
</div>
<div class="section" id="ucs_api_0018__en-us_topic_0121673684_section32975495318"><a name="ucs_api_0018__en-us_topic_0121673684_section32975495318"></a><a name="en-us_topic_0121673684_section32975495318"></a><h4 class="sectiontitle">Obtaining a Project ID on the Console</h4><div class="p" id="ucs_api_0018__en-us_topic_0121673684_p1356864351018">A project ID needs to be specified in the URIs of some APIs. Therefore, you need to obtain the project ID before calling APIs. The following procedure describes how to obtain a project ID:<ol id="ucs_api_0018__en-us_topic_0121673684_ol7453556171010"><li id="ucs_api_0018__en-us_topic_0121673684_li645315621018">Log in to the management console.</li><li id="ucs_api_0018__en-us_topic_0121673684_li142001547118">Click the username and select <strong id="ucs_api_0018__en-us_topic_0121673684_b10350181718117">My Credentials</strong> from the drop-down list.<p id="ucs_api_0018__en-us_topic_0121673684_p13639183110119">On the <strong id="ucs_api_0018__en-us_topic_0121673684_b19682129101113">My Credentials</strong> page, view project IDs in the project list.</p>
<div class="fignone" id="ucs_api_0018__en-us_topic_0121673684_fig12841949131317"><span class="figcap"><b>Figure 1 </b>Viewing project IDs</span><br><span><img id="ucs_api_0018__en-us_topic_0121673684_image1184449141315" src="en-us_image_0000002302518757.png"></span></div>
<p id="ucs_api_0018__en-us_topic_0121673684_p55531521415">In multi-project scenarios, expand the region, and obtain your sub-project ID from the <strong id="ucs_api_0018__en-us_topic_0121673684_b314916613146">Project ID</strong> column.</p>
</li></ol>
</div>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="ucs_api_0015.html">Appendix</a></div>
</div>
</div>