forked from docs/doc-exports
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com> Co-authored-by: Sheng, Lichang <lichangsheng1@noreply.gitea.eco.tsi-dev.otc-service.com> Co-committed-by: Sheng, Lichang <lichangsheng1@noreply.gitea.eco.tsi-dev.otc-service.com>
104 lines
7.7 KiB
HTML
104 lines
7.7 KiB
HTML
<a name="ocr_03_0006"></a><a name="ocr_03_0006"></a>
|
|
|
|
<h1 class="topictitle1">Response</h1>
|
|
<div id="body0000001696383140"><p id="ocr_03_0006__p198051334338">After sending a request, you will receive a response, including a status code, response header, and response body.</p>
|
|
<div class="section" id="ocr_03_0006__section107196345315"><h4 class="sectiontitle">Status Codes</h4><p id="ocr_03_0006__p158051934639">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="ocr_03_0090.html">Status Codes</a>.</p>
|
|
<p id="ocr_03_0006__p88055348314">If status code <strong id="ocr_03_0006__b1058414194371">201</strong> is returned, the request is successful.</p>
|
|
</div>
|
|
<div class="section" id="ocr_03_0006__section472020341318"><h4 class="sectiontitle">Response Header</h4><p id="ocr_03_0006__p178050348319">Similar to a request, a response also has a header, for example, <span class="parmvalue" id="ocr_03_0006__parmvalue8872877227589"><b>Content-Type</b></span>.</p>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="ocr_03_0006__table472415341318" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Common response headers </caption><thead align="left"><tr id="ocr_03_0006__row8805163418312"><th align="left" class="cellrowborder" valign="top" width="21.21%" id="mcps1.3.3.3.2.4.1.1"><p id="ocr_03_0006__p080519342317">Header</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="59.599999999999994%" id="mcps1.3.3.3.2.4.1.2"><p id="ocr_03_0006__p1680612349319">Description</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="19.189999999999998%" id="mcps1.3.3.3.2.4.1.3"><p id="ocr_03_0006__p1980613345319">Mandatory</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="ocr_03_0006__row080618341435"><td class="cellrowborder" valign="top" width="21.21%" headers="mcps1.3.3.3.2.4.1.1 "><p id="ocr_03_0006__p3806123411310">Content-Type</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="59.599999999999994%" headers="mcps1.3.3.3.2.4.1.2 "><p id="ocr_03_0006__p280612341532">Media type of the response body sent to a recipient</p>
|
|
<p id="ocr_03_0006__p118069341430">Type: string</p>
|
|
<p id="ocr_03_0006__p148061934037">Default value: <strong id="ocr_03_0006__b19260175018385">application/json; charset=UTF-8</strong></p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="19.189999999999998%" headers="mcps1.3.3.3.2.4.1.3 "><p id="ocr_03_0006__p9806113414311">Yes</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="ocr_03_0006__row1980615341236"><td class="cellrowborder" valign="top" width="21.21%" headers="mcps1.3.3.3.2.4.1.1 "><p id="ocr_03_0006__p580610343319">X-request-id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="59.599999999999994%" headers="mcps1.3.3.3.2.4.1.2 "><p id="ocr_03_0006__p1880610341139">Request ID for task tracing</p>
|
|
<p id="ocr_03_0006__p58064341732">Type: string <strong id="ocr_03_0006__b1325195015411">request_id-timestamp-hostname</strong> (<strong id="ocr_03_0006__b1632555034119">request_id</strong> is the UUID generated on the server. <strong id="ocr_03_0006__b14325650114116">timestamp</strong> indicates the current timestamp, and <strong id="ocr_03_0006__b83261850144116">hostname</strong> is the name of the server that processes the current API.)</p>
|
|
<p id="ocr_03_0006__p1780613340314">Default value: none</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="19.189999999999998%" headers="mcps1.3.3.3.2.4.1.3 "><p id="ocr_03_0006__p14806934634">No</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="ocr_03_0006__row1580611346315"><td class="cellrowborder" valign="top" width="21.21%" headers="mcps1.3.3.3.2.4.1.1 "><p id="ocr_03_0006__p198060341314">X-ratelimit</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="59.599999999999994%" headers="mcps1.3.3.3.2.4.1.2 "><p id="ocr_03_0006__p1280619341739">Total number of flow control requests</p>
|
|
<p id="ocr_03_0006__p380623415310">Type: integer</p>
|
|
<p id="ocr_03_0006__p280614341134">Default value: none</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="19.189999999999998%" headers="mcps1.3.3.3.2.4.1.3 "><p id="ocr_03_0006__p3806234937">No</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="ocr_03_0006__row13806134139"><td class="cellrowborder" valign="top" width="21.21%" headers="mcps1.3.3.3.2.4.1.1 "><p id="ocr_03_0006__p880615341432">X-ratelimit-used</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="59.599999999999994%" headers="mcps1.3.3.3.2.4.1.2 "><p id="ocr_03_0006__p78061834939">Number of remaining requests</p>
|
|
<p id="ocr_03_0006__p78071034732">Type: integer</p>
|
|
<p id="ocr_03_0006__p1480717341138">Default value: none</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="19.189999999999998%" headers="mcps1.3.3.3.2.4.1.3 "><p id="ocr_03_0006__p188072343312">No</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="ocr_03_0006__row128075341939"><td class="cellrowborder" valign="top" width="21.21%" headers="mcps1.3.3.3.2.4.1.1 "><p id="ocr_03_0006__p08072341638">X-ratelimit-window</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="59.599999999999994%" headers="mcps1.3.3.3.2.4.1.2 "><p id="ocr_03_0006__p28076341135">Flow control unit</p>
|
|
<p id="ocr_03_0006__p6807134634">Type: string. The unit is in minute, hour, or day.</p>
|
|
<p id="ocr_03_0006__p108078342315">Default value: hour</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="19.189999999999998%" headers="mcps1.3.3.3.2.4.1.3 "><p id="ocr_03_0006__p180711341239">No</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<p id="ocr_03_0006__p17807103413315">The message header shown in Figure 3-1 is returned.</p>
|
|
<p id="ocr_03_0006__p68071344313"><strong id="ocr_03_0006__b105101916154414">x-subject-token</strong> is the desired user token. This token can then be used to authenticate the calling of other APIs.</p>
|
|
<div class="fignone" id="ocr_03_0006__fig1976611301742"><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="ocr_03_0006__image117663301243" src="en-us_image_0000001744559845.png" height="304.2375" width="523.6875" title="Click to enlarge" class="imgResize"></span></div>
|
|
</div>
|
|
<div class="section" id="ocr_03_0006__section35351534857"><h4 class="sectiontitle">Response Body</h4><p id="ocr_03_0006__p116039341359">A response body conveys information other than the response header and is generally sent in a structured format (for example, JSON or XML) defined by the <strong id="ocr_03_0006__b207055664411">Content-Type</strong> field in the response header.</p>
|
|
<p id="ocr_03_0006__p166038342053">The following message body is returned. The following is part of the response body:</p>
|
|
<pre class="screen" id="ocr_03_0006__screen126037347519">{
|
|
"token": {
|
|
"expires_at": "2019-02-13T06:52:13.855000Z",
|
|
"methods": [
|
|
"password"
|
|
],
|
|
"catalog": [
|
|
{
|
|
"endpoints": [
|
|
{
|
|
"region_id": "********",
|
|
......</pre>
|
|
<p id="ocr_03_0006__p14604234853">If an error occurs during API calling, an error code and error message will be displayed. An error response body is shown as follows:</p>
|
|
<pre class="screen" id="ocr_03_0006__screen151710446507">{
|
|
"error_msg": "The input parameter is invalid.",
|
|
"error_code": "AIS.0101"
|
|
}</pre>
|
|
<p id="ocr_03_0006__p1060410341254">In the error response body, <strong id="ocr_03_0006__b1992594319458">error_code</strong> is an error code, and <strong id="ocr_03_0006__b12926143124510">error_msg</strong> provides information about the error. For more information, see <a href="ocr_03_0028.html">Error Codes</a>.</p>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="ocr_03_0001.html">API Calling</a></div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<script language="JavaScript">
|
|
<!--
|
|
image_size('.imgResize');
|
|
var msg_imageMax = "view original image";
|
|
var msg_imageClose = "close";
|
|
//--></script> |