doc-exports/docs/iam/api-ref/iam_02_0511.html
Wei, Hongmin 80f18fd272 IAM API 2.6 Version
Reviewed-by: Kabai, Zoltán Gábor <zoltan-gabor.kabai@t-systems.com>
Co-authored-by: Wei, Hongmin <weihongmin1@huawei.com>
Co-committed-by: Wei, Hongmin <weihongmin1@huawei.com>
2023-08-03 03:34:59 +00:00

46 lines
3.7 KiB
HTML

<a name="iam_02_0511"></a><a name="iam_02_0511"></a>
<h1 class="topictitle1">Response</h1>
<div id="body1602512924297"><div class="section" id="iam_02_0511__section968114282311"><h4 class="sectiontitle">Status Code</h4><p id="iam_02_0511__p4624111624411">After sending a request, you will receive a response, including the status code, response header, and response body.</p>
<p id="iam_02_0511__p124381044137">A status code is a group of digits, ranging from 1xx to 5xx. It indicates the status of a request. For more information, see <a href="iam_02_0005.html">Status Codes</a>.</p>
<p id="iam_02_0511__p2861496519">For example, if status code <strong id="iam_02_0511__b750114489250">201</strong> is returned for calling the API used to obtain a user token (<a href="en-us_topic_0057845583.html">Obtaining a User Token</a>), the request is successful.</p>
</div>
<div class="section" id="iam_02_0511__section7804143005810"><h4 class="sectiontitle">Response Header</h4><p id="iam_02_0511__p384320471837">Similar to a request, a response also has a header, for example, <span class="parmvalue" id="iam_02_0511__parmvalue75091743268"><b>Content-Type</b></span>.</p>
<p id="iam_02_0511__p4430113619484"><a href="en-us_topic_0057845583.html">Obtaining a User Token</a> shows the response header fields for the API used to obtain a user token (<a href="#iam_02_0511__fig4865141011511">Figure 1</a>). The <strong id="iam_02_0511__b73417128264">x-subject-token</strong> header field is the desired user token. This token can then be used to authenticate the calling of other APIs.</p>
<div class="fignone" id="iam_02_0511__fig4865141011511"><a name="iam_02_0511__fig4865141011511"></a><a name="fig4865141011511"></a><span class="figcap"><b>Figure 1 </b>Header fields of the response to the request for obtaining a user token</span><br><span><img id="iam_02_0511__image48651610135113" src="en-us_image_0283060057.png" height="304.2375" width="523.6875" title="Click to enlarge" class="imgResize"></span></div>
</div>
<div class="section" id="iam_02_0511__section034615592583"><h4 class="sectiontitle">Response Body</h4><p id="iam_02_0511__p133921631940">The body of a response is often returned in structured format as specified in the <strong id="iam_02_0511__b983511732713">Content-Type</strong> header field. The response body transfers content except the response header.</p>
<p id="iam_02_0511__p157041652367">The following is part of the response body for the API used to obtain a user token (<a href="en-us_topic_0057845583.html">Obtaining a User Token</a>).</p>
<pre class="screen" id="iam_02_0511__screen65818201917">{
"token": {
"expires_at": "2019-02-13T06:52:13.855000Z",
"methods": [
"password"
],
"catalog": [
{
"endpoints": [
{
"region_id": "az-01",
......</pre>
<p id="iam_02_0511__p127537375412">If an error occurs during API calling, an error code and error description will be displayed. The following shows an error response body:</p>
<pre class="screen" id="iam_02_0511__screen102091730125513">{
"error_msg": "The format of message is error",
"error_code": "AS.0001"
}</pre>
<p id="iam_02_0511__p1589911464018">In the response body, <strong id="iam_02_0511__b877045112317">error_code</strong> is an error code, and <strong id="iam_02_0511__b1677605114313">error_msg</strong> provides information about the error.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="iam_02_0000.html">Calling APIs</a></div>
</div>
</div>
<script language="JavaScript">
<!--
image_size('.imgResize');
var msg_imageMax = "view original image";
var msg_imageClose = "close";
//--></script>