doc-exports/docs/kms/api-ref/kms_02_0056.html
Li, Qiao dfe65b9551 KMS API 20230817 version.
Reviewed-by: Belejkanic, Lukas <lukas.belejkanic@t-systems.com>
Co-authored-by: Li, Qiao <qiaoli@huawei.com>
Co-committed-by: Li, Qiao <qiaoli@huawei.com>
2024-04-02 13:42:22 +00:00

48 lines
4.9 KiB
HTML

<a name="kms_02_0056"></a><a name="kms_02_0056"></a>
<h1 class="topictitle1">Returned Values</h1>
<div id="body8662426"><div class="section" id="kms_02_0056__en-us_topic_0171850912_en-us_topic_0169294978_section968114282311"><h4 class="sectiontitle">Status Code</h4><p id="kms_02_0056__en-us_topic_0169294978_p4624111624411">After sending a request, you will receive a response containing the status code, response header, and response body.</p>
<p id="kms_02_0056__en-us_topic_0169294978_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="kms_02_0301.html">Status Code</a>.</p>
<p id="kms_02_0056__en-us_topic_0169294978_p2861496519">For example, if status code <span class="parmvalue" id="kms_02_0056__en-us_topic_0207581477_parmvalue2084451105011"><b>201</b></span> is returned for calling the API used to <a href="https://docs.otc.t-systems.com/en-us/api/iam/en-us_topic_0057845583.html" target="_blank" rel="noopener noreferrer">obtain a user token</a>, the request is successful.</p>
</div>
<div class="section" id="kms_02_0056__en-us_topic_0171850912_en-us_topic_0169294978_section7804143005810"><h4 class="sectiontitle">Response Header</h4><p id="kms_02_0056__en-us_topic_0207581477_en-us_topic_0169294978_p384320471837">A response header corresponds to a request header, for example, <span class="parmvalue" id="kms_02_0056__en-us_topic_0207581477_parmvalue3135124752317"><b>Content-Type</b></span>.</p>
<p id="kms_02_0056__en-us_topic_0207581477_en-us_topic_0169294978_p4430113619484"><a href="#kms_02_0056__en-us_topic_0207581477_en-us_topic_0169294978_fig4865141011511">Figure 1</a> shows the response header for the API of <a href="https://docs.otc.t-systems.com/en-us/api/iam/en-us_topic_0057845583.html" target="_blank" rel="noopener noreferrer">obtaining a user token</a>, in which <span class="parmname" id="kms_02_0056__en-us_topic_0207581477_parmname9685151124613"><b>x-subject-token</b></span> is the desired user token. Then, you can use the token to authenticate the calling of other APIs.</p>
<div class="fignone" id="kms_02_0056__en-us_topic_0207581477_en-us_topic_0169294978_fig4865141011511"><a name="kms_02_0056__en-us_topic_0207581477_en-us_topic_0169294978_fig4865141011511"></a><a name="en-us_topic_0207581477_en-us_topic_0169294978_fig4865141011511"></a><span class="figcap"><b>Figure 1 </b>Header of the response to the request for obtaining a user token</span><br><span><img id="kms_02_0056__en-us_topic_0207581477_en-us_topic_0169294978_image48651610135113" src="en-us_image_0218769431.png" title="Click to enlarge" class="imgResize"></span></div>
</div>
<div class="section" id="kms_02_0056__en-us_topic_0171850912_en-us_topic_0169294978_section034615592583"><h4 class="sectiontitle">(Optional) Response Body</h4><p id="kms_02_0056__en-us_topic_0207581477_en-us_topic_0169294978_p133921631940">A response body is generally returned in a structured format, corresponding to the <strong id="kms_02_0056__en-us_topic_0207581477_b416318281247">Content-Type</strong> in the response header, and is used to transfer content other than the response header.</p>
<p id="kms_02_0056__en-us_topic_0207581477_en-us_topic_0169294978_p157041652367">The following shows part of the response body for the API to <a href="https://docs.otc.t-systems.com/en-us/api/iam/en-us_topic_0057845583.html" target="_blank" rel="noopener noreferrer">obtain a user token</a>. For the sake of space, only part of the content is displayed here.</p>
<pre class="screen" id="kms_02_0056__en-us_topic_0207581477_en-us_topic_0169294978_screen65818201917">{
"token": {
"expires_at": "2019-02-13T06:52:13.855000Z",
"methods": [
"password"
],
"catalog": [
{
"endpoints": [
{
"region_id": "xxxxxxxx",
......</pre>
<p id="kms_02_0056__en-us_topic_0207581477_en-us_topic_0169294978_p127537375412">If an error occurs during API calling, the system returns an error code and a message to you. The following shows the format of an error response body:</p>
<pre class="screen" id="kms_02_0056__en-us_topic_0207581477_en-us_topic_0169294978_screen102091730125513">{
"error": {
"message": "The request you have made requires authentication.",
"title": "Unauthorized"
}
}</pre>
<p id="kms_02_0056__en-us_topic_0207581477_en-us_topic_0169294978_p1589911464018">In the preceding information, <strong id="kms_02_0056__en-us_topic_0207581477_b2065921513256">error_code</strong> is an error code, and <strong id="kms_02_0056__en-us_topic_0207581477_b2066018159256">error_msg</strong> describes the error.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="kms_02_0002.html">Calling APIs</a></div>
</div>
</div>
<script language="JavaScript">
<!--
image_size('.imgResize');
var msg_imageMax = "view original image";
var msg_imageClose = "close";
//--></script>