forked from docs/doc-exports
Reviewed-by: Eotvos, Oliver <oliver.eotvos@t-systems.com> Co-authored-by: Chen, Junjie <chenjunjie@huawei.com> Co-committed-by: Chen, Junjie <chenjunjie@huawei.com>
41 lines
4.0 KiB
HTML
41 lines
4.0 KiB
HTML
<a name="functiongraph_06_0220"></a><a name="functiongraph_06_0220"></a>
|
|
|
|
<h1 class="topictitle1">Response</h1>
|
|
<div id="body27707615"><div class="section" id="functiongraph_06_0220__section107916468177"><h4 class="sectiontitle">Status Code</h4><p id="functiongraph_06_0220__p19997154601712">After sending a request, you will receive a response, including a status code, response header, and response body.</p>
|
|
<p id="functiongraph_06_0220__p099714614174">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="functiongraph_06_1310.html">Status Codes</a>.</p>
|
|
<p id="functiongraph_06_0220__p4997104651719">For example, 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="functiongraph_06_0220__section379914611710"><h4 class="sectiontitle">Response Header</h4><p id="functiongraph_06_0220__p1299710464179">Similar to a request, a response also has a header, for example, <strong id="functiongraph_06_0220__b13933203594711">Content-Type</strong>.</p>
|
|
<p id="functiongraph_06_0220__p1699784631711"><a href="#functiongraph_06_0220__fig1999718469177">Figure 1</a> shows the response header fields 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>. The <strong id="functiongraph_06_0220__b12352856191910">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="functiongraph_06_0220__fig1999718469177"><a name="functiongraph_06_0220__fig1999718469177"></a><a name="fig1999718469177"></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="functiongraph_06_0220__image1499714467179" src="en-us_image_0000001433216038.gif"></span></div>
|
|
</div>
|
|
<div class="section" id="functiongraph_06_0220__section7817946101717"><h4 class="sectiontitle">Response Body</h4><p id="functiongraph_06_0220__p999734613174">The body of a response is often returned in structured format as specified in the <strong id="functiongraph_06_0220__b281614918493">Content-Type</strong> header field. The response body transfers content except the response header.</p>
|
|
<p id="functiongraph_06_0220__p15997164620175">The following is part of the response body 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>.</p>
|
|
<pre class="codeblock" id="functiongraph_06_0220__codeblock20280171262011">{
|
|
"token": {
|
|
"expires_at": "2019-02-13T06:52:13.855000Z",
|
|
"methods": [
|
|
"password"
|
|
],
|
|
"catalog": [
|
|
{
|
|
"endpoints": [
|
|
{
|
|
"region_id": "XXXXXXXX",
|
|
......
|
|
</pre>
|
|
<p id="functiongraph_06_0220__p29971465176">If an error occurs during API calling, an error code and a message will be displayed. The following shows an error response body.</p>
|
|
<pre class="codeblock" id="functiongraph_06_0220__codeblock1874640915049">{
|
|
"error_code": "FGS.0111",
|
|
"error_msg": "xxxxxxxxx"
|
|
} </pre>
|
|
<p id="functiongraph_06_0220__p141517391210">In the response body, <strong id="functiongraph_06_0220__b105641756164916">error_code</strong> is an error code, and <strong id="functiongraph_06_0220__b14031659164910">error_msg</strong> provides information about the error.</p>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="functiongraph_06_0200.html">Calling APIs</a></div>
|
|
</div>
|
|
</div>
|
|
|