forked from docs/doc-exports
Reviewed-by: Boka, Ladislav <ladislav.boka@t-systems.com> Co-authored-by: Ru, Li Yi <liyiru7@huawei.com> Co-committed-by: Ru, Li Yi <liyiru7@huawei.com>
40 lines
4.4 KiB
HTML
40 lines
4.4 KiB
HTML
<a name="nosql_05_0010"></a><a name="nosql_05_0010"></a>
|
|
|
|
<h1 class="topictitle1">Returned Values</h1>
|
|
<div id="body0000001355017980"><div class="section" id="nosql_05_0010__en-us_topic_0170155703_section968114282311"><h4 class="sectiontitle">Status Code</h4><p id="nosql_05_0010__en-us_topic_0170155703_p4624111624411">After you send a request, you will receive a response, including a status code, response header, and response body.</p>
|
|
<p id="nosql_05_0010__en-us_topic_0170155703_p124381044137">A status code is a group of digits ranging from 1xx to 5xx. It indicates the status of a response. For more information, see <a href="nosql_status_code.html">Status Codes</a>.</p>
|
|
<p id="nosql_05_0010__en-us_topic_0170155703_p2861496519">If status code 201 is returned for calling the API used to <a href="https://docs.otc.t-systems.com/identity-access-management/api-ref/apis/token_management/obtaining_a_user_token.html" target="_blank" rel="noopener noreferrer">obtain a user token</a>, the request is successful.</p>
|
|
</div>
|
|
<div class="section" id="nosql_05_0010__en-us_topic_0170155703_en-us_topic_0113746487_section61333484715"><h4 class="sectiontitle">Response Header</h4><p id="nosql_05_0010__en-us_topic_0170155703_p384320471837">Similar to a request, a response also has a header, for example, <span class="parmvalue" id="nosql_05_0010__parmvalue19700316194919"><b>Content-Type</b></span>.</p>
|
|
<p id="nosql_05_0010__en-us_topic_0170155703_p4430113619484"><a href="#nosql_05_0010__en-us_topic_0170155703_fig4865141011511">Figure 1</a> shows the response header for the API used to <a href="https://docs.otc.t-systems.com/identity-access-management/api-ref/apis/token_management/obtaining_a_user_token.html" target="_blank" rel="noopener noreferrer">obtain a user token</a>, in which <span class="parmname" id="nosql_05_0010__parmname1677102494912"><b>x-subject-token</b></span> is the required user token. Then, this token can be used to authenticate the calling of other APIs.</p>
|
|
<div class="fignone" id="nosql_05_0010__en-us_topic_0170155703_fig4865141011511"><a name="nosql_05_0010__en-us_topic_0170155703_fig4865141011511"></a><a name="en-us_topic_0170155703_fig4865141011511"></a><span class="figcap"><b>Figure 1 </b>Response header for the API used to obtain a user token</span><br><span><img id="nosql_05_0010__en-us_topic_0170155703_image48651610135113" src="en-us_image_0000001355018024.png"></span></div>
|
|
</div>
|
|
<div class="section" id="nosql_05_0010__en-us_topic_0170155703_en-us_topic_0113746487_section2045571671419"><h4 class="sectiontitle">(Optional) Response Body</h4><p id="nosql_05_0010__en-us_topic_0170155703_en-us_topic_0113746487_p64711881416">This part is optional. A response body is generally returned in a structured format (for example, JSON or XML), corresponding to <strong id="nosql_05_0010__b15821146115015">Content-Type</strong> in the response header, and is used to transfer content other than the response header.</p>
|
|
</div>
|
|
<p id="nosql_05_0010__en-us_topic_0170155703_p157041652367">If the following information is returned for calling the API used to <a href="https://docs.otc.t-systems.com/identity-access-management/api-ref/apis/token_management/obtaining_a_user_token.html" target="_blank" rel="noopener noreferrer">obtain a user token</a>, the request is successful. The following describes part of the request body.</p>
|
|
<pre class="screen" id="nosql_05_0010__en-us_topic_0170155703_screen65818201917">{
|
|
"token": {
|
|
"expires_at": "2019-02-13T06:52:13.855000Z",
|
|
"methods": [
|
|
"password"
|
|
],
|
|
"catalog": [
|
|
{
|
|
"endpoints": [
|
|
{
|
|
"region_id": "<em id="nosql_05_0010__i3794192712288">aaa</em>",
|
|
......</pre>
|
|
<p id="nosql_05_0010__en-us_topic_0170155703_p127537375412">If an error occurs during API calling, an error code and error message will be displayed. The following is an error response body:</p>
|
|
<pre class="screen" id="nosql_05_0010__en-us_topic_0170155703_screen102091730125513">{
|
|
"error_msg": "Parameter error",
|
|
"error_code": "DBS.200001"
|
|
}</pre>
|
|
<p id="nosql_05_0010__en-us_topic_0170155703_p1589911464018">In the response, <strong id="nosql_05_0010__b3168706525">error_code</strong> indicates an error code, and <strong id="nosql_05_0010__b21789085219">error_msg</strong> describes the error.</p>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="nosql_05_0007.html">Calling APIs</a></div>
|
|
</div>
|
|
</div>
|
|
|