{"componentChunkName":"component---src-templates-tutorial-js","path":"/en/tutorial/token/","result":{"data":{"markdownRemark":{"html":"<h2 id=\"token\"><a href=\"#token\" aria-hidden class=\"anchor\"><svg aria-hidden=\"true\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>token</h2>\n<h3 id=\"uri\"><a href=\"#uri\" aria-hidden class=\"anchor\"><svg aria-hidden=\"true\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>URI</h3>\n<p><code class=\"gatsby-code-text\">http://{Keycloak server}:{Keycloak port}/auth/realms/imanager/protocol/openid-connect/token</code></p>\n<h3 id=\"supported-methods\"><a href=\"#supported-methods\" aria-hidden class=\"anchor\"><svg aria-hidden=\"true\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Supported Methods</h3>\n<p>POST</p>\n<h3 id=\"introduction\"><a href=\"#introduction\" aria-hidden class=\"anchor\"><svg aria-hidden=\"true\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Introduction</h3>\n<p>Gets Token according to account information.</p>\n<p>Supported representation format: JSON.</p>\n<h3 id=\"http-request-method\"><a href=\"#http-request-method\" aria-hidden class=\"anchor\"><svg aria-hidden=\"true\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>HTTP Request Method</h3>\n<p>An HTTP request is performed on the following URI. Here we take JSON output format for illustration. <code class=\"gatsby-code-text\">{Keycloak server}</code> is the server name of Keycloak, you need to replace by the actual server IP; <code class=\"gatsby-code-text\">{Keycloak port}</code> is the port number of Keycloak, you need to replace by the actual port.</p>\n<p><code class=\"gatsby-code-text\">http://{Keycloak server}:{Keycloak port}/auth/realms/imanager/protocol/openid-connect/token</code></p>\n<h4 id=\"post-request\"><a href=\"#post-request\" aria-hidden class=\"anchor\"><svg aria-hidden=\"true\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Post Request</h4>\n<p>Gets Token according to account information.</p>\n<h4 id=\"headers-format\"><a href=\"#headers-format\" aria-hidden class=\"anchor\"><svg aria-hidden=\"true\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Headers Format</h4>\n<p>Content-Type: application/x-www-form-urlencoded</p>\n<p>Host: <code class=\"gatsby-code-text\">{Keycloak server}</code>:<code class=\"gatsby-code-text\">{Keycloak port}</code></p>\n<h4 id=\"request-params\"><a href=\"#request-params\" aria-hidden class=\"anchor\"><svg aria-hidden=\"true\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Request Params</h4>\n<p>Transmit the following parameters in the body when getting token:</p>\n<table class=\"rtTable\" cellspacing=\"0\" width=\"80%\" align=\"center\">\n\t<col style=\"width: 15%;\" />\n\t<col style=\"width: 15%;\" />\n\t<col style=\"width: 70%;\" />\n\t<tr class=\"t1st\" style=\"height: 20px;\">\n\t\t<th>Name</th>\n\t\t<th>Type</th>\n\t\t<th>Explanation</th>\n\t</tr>\n\t<tr class=\"t2Row\" style=\"height: 20px;\">\n\t\t<td>client_id</td>\n\t\t<td>String</td>\n\t\t<td>Product name('imanager' is the fixed parameter)</td>\n\t</tr>\n\t<tr class=\"t1Row\" style=\"height: 20px;\">\n\t\t<td>username</td>\n\t\t<td>String</td>\n\t\t<td>Username</td>\n\t</tr>\n\t<tr class=\"t2Row\" style=\"height: 20px;\">\n\t\t<td>password</td>\n\t\t<td>String</td>\n\t\t<td>Password</td>\n\t</tr>\n\t<tr class=\"t1Row\" style=\"height: 20px;\">\n\t\t<td>grant_type</td>\n\t\t<td>String</td>\n\t\t<td>Type obtained('password' is the fixed parameter)</td>\n\t</tr>\n</table>\n<h4 id=\"response-structure\"><a href=\"#response-structure\" aria-hidden class=\"anchor\"><svg aria-hidden=\"true\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Response Structure</h4>\n<table class=\"rtTable\" cellspacing=\"0\" width=\"80%\" align=\"center\">\n\t<col style=\"width: 40%;\" />\n\t<col />\n\t<tr class=\"t1st\">\n\t\t<th>Name</th>\n\t\t<th>Explanation</th>\n\t</tr>\n\t<tr class=\"t2Row\">\n\t\t<td>access_token</td>\n\t\t<td>The token for access</td>\n\t</tr>\n\t<tr class=\"t1Row\">\n\t\t<td>expires_in</td>\n\t\t<td>The expired time of the access_token</td>\n\t</tr>\n\t<tr class=\"t2Row\">\n\t\t<td>refresh_expires_in</td>\n\t\t<td>The expired time of the refresh_token</td>\n\t</tr>\n\t<tr class=\"t1Row\">\n\t\t<td>refresh_token</td>\n\t\t<td>Used for refresh the token when the token is expired</td>\n\t</tr>\n\t<tr class=\"t2Row\">\n\t\t<td>token_type</td>\n\t\t<td>The type of the token</td>\n\t</tr>\n</table>\n<h4 id=\"response-case\"><a href=\"#response-case\" aria-hidden class=\"anchor\"><svg aria-hidden=\"true\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Response Case</h4>\n<p>Execute POST request for token resource. URL: <code class=\"gatsby-code-text\">http://192.168.17.139:30474/auth/realms/imanager/protocol/openid-connect/token</code>.</p>\n<p>Headers:</p>\n<div class=\"gatsby-highlight\" data-language=\"jsxon\"><pre class=\"gatsby-code-jsxon\"><code class=\"gatsby-code-jsxon\">Content-Type: application/x-www-form-urlencoded</code></pre></div>\n<div class=\"gatsby-highlight\" data-language=\"jsxon\"><pre class=\"gatsby-code-jsxon\"><code class=\"gatsby-code-jsxon\">Host: 192.168.17.139:30474</code></pre></div>\n<p>Body:</p>\n<div class=\"gatsby-highlight\" data-language=\"jsxon\"><pre class=\"gatsby-code-jsxon\"><code class=\"gatsby-code-jsxon\">client_id=imanager&amp;username=admin&amp;password=admin&amp;grant_type=password</code></pre></div>\n<p>Returned response:</p>\n<div class=\"gatsby-highlight\" data-language=\"jsxon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SU4iXX0sImFjY291bnQiOnsicm9sZXMiOlsibWFuYWdlLWFjY291bnQiLCJtYW5hZ2UtYWNjb3VudC1saW5rcyIsInZpZXctcHJvZmlsZSJdfX0sInNjb3BlIjoiZW1haWwgcHJvZmlsZSJ9.wYCP_SBRaMILwFHr63vudKASt7KV9eBHzQMet3XPUFw&quot;,\n&quot;token_type&quot;:&quot;bearer&quot;,\n&quot;not-before-policy&quot;:0,\n&quot;session_state&quot;:&quot;0dd081f8-caaf-4c3c-8f5e-d45f707f5569&quot;,\n&quot;scope&quot;:&quot;email profile&quot;\n}</code></pre></div>\n<p>If the returned response you get was same as the example, you have got the token successfully, the token is the content in ‘access_token’. You can use the token to visit SuperMap iManager.</p>\n<h4 id=\"how-to-use-token\"><a href=\"#how-to-use-token\" aria-hidden class=\"anchor\"><svg aria-hidden=\"true\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>How to use token</h4>\n<p>After getting the access_token by POST request, execute the resource request, take <code class=\"gatsby-code-text\">http://{iManager server}:{iManager port}/imanager/dashboard/web/api/alert/problem</code> as an example. There are three methods to achieve resource request, they are Authroization Header, Form-Encoded Body Parameter, and URI Query Parameter. The three methods decrement by priority.</p>\n<blockquote>\n<p>Notes:  </p>\n<ol>\n<li>The expiration time of access_token is 5 minutes. If the token was expired, used refresh_token to get the new token(the expiration time of refresh_token is 30 minutes), or reacquire the access_token.  </li>\n<li><code class=\"gatsby-code-text\">{iManager server}</code> and <code class=\"gatsby-code-text\">{iManager port}</code> in the URL are the IP and port number of iManager.(The IP and port number you used when getting token was the Keycloak’s IP and port)</li>\n</ol>\n</blockquote>\n<p><strong>Authorization Header</strong></p>\n<p>The format of Headers:</p>\n<p>GET <code class=\"gatsby-code-text\">{resource}</code> HTTP/1.1</p>\n<div class=\"gatsby-highlight\" data-language=\"jsxon\"><pre class=\"gatsby-code-jsxon\"><code class=\"gatsby-code-jsxon\">Host:server:port\nAuthorization: Bearer {access_token}</code></pre></div>\n<p>Example:</p>\n<p>GET <code class=\"gatsby-code-text\">http://192.168.17.139:31100/imanager/dashboard/web/api/alert/problem</code> HTTP/1.1</p>\n<div class=\"gatsby-highlight\" data-language=\"jsxon\"><pre class=\"gatsby-code-jsxon\"><code class=\"gatsby-code-jsxon\">Host: 192.168.17.139:31100\n\nauthorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJlWVE3WDVFaGMxeV9mbUl5RGtoZEhFejlxSjNPYWp1enR3RG9ybW8zaGFnIn0.eyJqdGkiOiIyMjA0ODNiMi05OGZjLTRmZDYtYmY2ZS1mOTkxYmE2NTAwZGYiLCJleHAiOjE1NTE4NjUwMDEsIm5iZiI6MCwiaWF0IjoxNTUxODY0NzAxLCJpc3MiOiJodHRwOi8vMTkyLjE2OC4xNy4xMzk6MzA0NzQvYXV0aC9yZWFsbXMvaW1hbmFnZXIiLCJhdWQiOiJpbWFuYWdlciIsInN1YiI6ImJkYTBlYmY1LWE3OGEtNDljMS05M2NkLWIyN2FhN2E2MzkxYyIsInR5cCI6IkJlYXJlciIsImF6cCI6ImltYW5hZ2VyIiwiYXV0aF90aW1lIjowLCJzZXNzaW9uX3N0YXRlIjoiZWEzNTZkMmMtOWM2MS00OTE0LTk3ZGYtZDY2NDAyMDYwNWEwIiwiYWNyIjoiMSIsImFsbG93ZWQtb3JpZ2lucyI6WyIqIl0sInJlYWxtX2FjY2VzcyI6eyJyb2xlcyI6WyJvZmZsaW5lX2FjY2VzcyIsImFkbWluIiwidW1hX2F1dGhvcml6YXRpb24iLCJ1c2VycyJdfSwicmVzb3VyY2VfYWNjZXNzIjp7ImlzZXJ2ZXItMTQiOnsicm9sZXMiOlsiQURNSU4iXX0sImFjY291bnQiOnsicm9sZXMiOlsibWFuYWdlLWFjY291bnQiLCJtYW5hZ2UtYWNjb3VudC1saW5rcyIsInZpZXctcHJvZmlsZSJdfX0sInNjb3BlIjoiZW1haWwgcHJvZmlsZSIsImVtYWlsX3ZlcmlmaWVkIjpmYWxzZSwicHJlZmVycmVkX3VzZXJuYW1lIjoiYWRtaW4iLCJsb2NhbGUiOiJ6aC1DTiJ9.ej6Ct3oY7EJaaqIGltaJeyBlyC6lbo7ovQ6Hj6s9VSLPweoA7ugz5EGJiFdKcUojYen_RpdHSYsrwuFtYVEu9iTLDVdnxqmpGon90_XsuyA0TQEj9nJQ7IU7WaaqeHdSDMwA7m-QZHXZ0hkURyun18uTcp6JqkXWrynT9_wZZqe_ICpAUxsNUx4p3rBxxt6dlNmvPOLoqv8SIs9_wpJ0Mo`HKZ0RLR0Fwr14eHcCIHwgleMcOKqMHwCE_GmIVEvgZbO-SiaZQ6Vv4aP670FB_1DnEwqperTeFxpKQLdDfjOe-xF82DaNqBufAdm7FyG4OPc991ixm33fM8Yl-lmTM-Q`</code></pre></div>\n<p>The returned response in json format:</p>\n<div class=\"gatsby-highlight\" data-language=\"jsxon\"><pre class=\"gatsby-code-jsxon\"><code class=\"gatsby-code-jsxon\">{\n  &quot;number&quot;:0,\n  &quot;from&quot;:0,\n  &quot;to&quot;:0\n}</code></pre></div>\n<p><strong>Form-Encoded Body Parameter</strong></p>\n<p>Use this method when the client does not support the method Authorization Header.</p>\n<p>The format of Headers:</p>\n<p>POST <code class=\"gatsby-code-text\">{resource}</code> HTTP/1.1</p>\n<div class=\"gatsby-highlight\" data-language=\"jsxon\"><pre class=\"gatsby-code-jsxon\"><code class=\"gatsby-code-jsxon\">Host: {server}:{port}\nContent-Type: application/x-www-form-urlencoded</code></pre></div>\n<p>The format of Body:</p>\n<div class=\"gatsby-highlight\" data-language=\"jsxon\"><pre class=\"gatsby-code-jsxon\"><code class=\"gatsby-code-jsxon\">access_token={access_token}</code></pre></div>\n<blockquote>\n<p>Notes:<br>\nForm-Encoded Body Parameter does not support GET request, the request body must follow the application/x-www-form-urlencoded coding, separate the parameters by symbol ’&#x26;‘.</p>\n</blockquote>\n<p><strong>URI Query Parameter</strong></p>\n<p>Use this method when both of Authorization Header and Form-Encoded Body Parameter could not request.</p>\n<p>The format of Headers:</p>\n<p>GET <code class=\"gatsby-code-text\">{resource}</code>?access_token=<code class=\"gatsby-code-text\">{access_token}</code> HTTP/1.1</p>\n<div class=\"gatsby-highlight\" data-language=\"jsxon\"><pre class=\"gatsby-code-jsxon\"><code class=\"gatsby-code-jsxon\">Host: {serer}:{port}\nCache-Control: no-store</code></pre></div>\n<p>Example:</p>\n<p>Get <code class=\"gatsby-code-text\">http://192.168.17.139:31100/imanager/dashboard/web/api/alert/problem?</code>access_token=eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJlWVE3WDVFaGMxeV9mbUl5RGtoZEhFejlxSjNPYWp1enR3RG9ybW8zaGFnIn0.eyJqdGkiOiIyMjA0ODNiMi05OGZjLTRmZDYtYmY2ZS1mOTkxYmE2NTAwZGYiLCJleHAiOjE1NTE4NjUwMDEsIm5iZiI6MCwiaWF0IjoxNTUxODY0NzAxLCJpc3MiOiJodHRwOi8vMTkyLjE2OC4xNy4xMzk6MzA0NzQvYXV0aC9yZWFsbXMvaW1hbmFnZXIiLCJhdWQiOiJpbWFuYWdlciIsInN1YiI6ImJkYTBlYmY1LWE3OGEtNDljMS05M2NkLWIyN2FhN2E2MzkxYyIsInR5cCI6IkJlYXJlciIsImF6cCI6ImltYW5hZ2VyIiwiYXV0aF90aW1lIjowLCJzZXNzaW9uX3N0YXRlIjoiZWEzNTZkMmMtOWM2MS00OTE0LTk3ZGYtZDY2NDAyMDYwNWEwIiwiYWNyIjoiMSIsImFsbG93ZWQtb3JpZ2lucyI6WyIqIl0sInJlYWxtX2FjY2VzcyI6eyJyb2xlcyI6WyJvZmZsaW5lX2FjY2VzcyIsImFkbWluIiwidW1hX2F1dGhvcml6YXRpb24iLCJ1c2VycyJdfSwicmVzb3VyY2VfYWNjZXNzIjp7ImlzZXJ2ZXItMTQiOnsicm9sZXMiOlsiQURNSU4iXX0sImFjY291bnQiOnsicm9sZXMiOlsibWFuYWdlLWFjY291bnQiLCJtYW5hZ2UtYWNjb3VudC1saW5rcyIsInZpZXctcHJvZmlsZSJdfX0sInNjb3BlIjoiZW1haWwgcHJvZmlsZSIsImVtYWlsX3ZlcmlmaWVkIjpmYWxzZSwicHJlZmVycmVkX3VzZXJuYW1lIjoiYWRtaW4iLCJsb2NhbGUiOiJ6aC1DTiJ9.ej6Ct3oY7EJaaqIGltaJeyBlyC6lbo7ovQ6Hj6s9VSLPweoA7ugz5EGJiFdKcUojYen_RpdHSYsrwuFtYVEu9iTLDVdnxqmpGon90_XsuyA0TQEj9nJQ7IU7WaaqeHdSDMwA7m-QZHXZ0hkURyun18uTcp6JqkXWrynT9_wZZqe_ICpAUxsNUx4p3rBxxt6dlNmvPOLoqv8SIs9_wpJ0MoHKZ0RLR0Fwr14eHcCIHwgleMcOKqMHwCE_GmIVEvgZbO-SiaZQ6Vv4aP670FB_1DnEwqperTeFxpKQLdDfjOe-xF82DaNqBufAdm7FyG4OPc991ixm33fM8Yl-lmTM-Q HTTP/1.1</p>\n<div class=\"gatsby-highlight\" data-language=\"jsxon\"><pre class=\"gatsby-code-jsxon\"><code class=\"gatsby-code-jsxon\">Host: 192.168.17.139:31100\nCache-Control: no-store</code></pre></div>\n<p>The returned rensponse in json format:</p>\n<div class=\"gatsby-highlight\" data-language=\"jsxon\"><pre class=\"gatsby-code-jsxon\"><code class=\"gatsby-code-jsxon\">{\n   &quot;number&quot;:0,\n   &quot;from&quot;:0,\n   &quot;to&quot;:0\n}</code></pre></div>","frontmatter":{"title":"APIs","next":null,"prev":null},"fields":{"path":"content/tutorial/token.en.md","slug":"/en/tutorial/token/","langKey":"en"}}},"pageContext":{"slug":"/en/tutorial/token/"}}}