{"componentChunkName":"component---src-templates-simple-markdown-js","path":"/cpm/developer/rest-api/how-to/javascript/","matchPath":"","result":{"data":{"markdownRemark":{"html":"<h1 style=\"position:relative;\"><a href=\"#using-the-rest-api-from-javascript\" aria-label=\"using the rest api from javascript permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" 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><div class=\"hidden-anchor\" id=\"using-the-rest-api-from-javascript\"></div>Using the REST API from JavaScript</h1>\n<p>Client-side (i.e. browser-based) JavaScript will most likely use the <a href=\"https://developer.mozilla.org/en/docs/Web/API/Fetch_API\">Fetch API</a> to access Celonis Process Management and will be subject to <a href=\"https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS\">HTTP access control aka CORS</a>.</p>\n<p>As of today, Celonis Process Management allows every origin by responding with the header <code class=\"language-text\">Access-Control-Allow-Origin: *</code>, but does not allow any additional headers, especially <code class=\"language-text\">Access-Control-Allow-Headers: symbio-auth-token</code>. For that reason the authentication token cannot be sent via HTTP headers. Instead it should be sent as part of the query string by appending <code class=\"language-text\">?symbio-auth-token=&lt;token></code> if no query has been specified yet, or <code class=\"language-text\">&amp;symbio-auth-token=&lt;token></code> if one already exists in your URL.</p>\n<h2 style=\"position:relative;\"><a href=\"#getting-the-storage-info-with-javascript\" aria-label=\"getting the storage info with javascript permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" 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><div class=\"hidden-anchor\" id=\"getting-the-storage-info-with-javascript\"></div>Getting the Storage Info with JavaScript</h2>\n<div class=\"code-wrapper\">\n        <div class=\"gatsby-code-button-container\"\n             data-toaster-id=\"29872539952448406000\"\n             data-toaster-duration=\"1500\"\n             onClick=\"copyCodeToClipboard(`const url = 'https://example.symbioweb.com/Collection/Database/_api/rest/info';\nconst tokenQuery = 'symbio-auth-token=<token>';\n\nconst response = await fetch(\\\\`\\\\${url}?\\\\${tokenQuery}\\\\`, { method: 'POST' });\nconst info = await response.json();`, `29872539952448406000`)\"\n        >\n          <div class=\"gatsby-code-button\" title=\"Copy the code snippet\">Copy</div>\n          <div class=\"done-indicator done-indicator-29872539952448406000\">Copied</div>\n        </div>\n        <div class=\"gatsby-highlight\" data-language=\"js\"><pre class=\"language-js\"><code class=\"language-js\"><span class=\"token keyword\">const</span> url <span class=\"token operator\">=</span> <span class=\"token string\">'https://example.symbioweb.com/Collection/Database/_api/rest/info'</span><span class=\"token punctuation\">;</span>\n<span class=\"token keyword\">const</span> tokenQuery <span class=\"token operator\">=</span> <span class=\"token string\">'symbio-auth-token=&lt;token>'</span><span class=\"token punctuation\">;</span>\n\n<span class=\"token keyword\">const</span> response <span class=\"token operator\">=</span> <span class=\"token keyword\">await</span> <span class=\"token function\">fetch</span><span class=\"token punctuation\">(</span><span class=\"token template-string\"><span class=\"token template-punctuation string\">`</span><span class=\"token interpolation\"><span class=\"token interpolation-punctuation punctuation\">${</span>url<span class=\"token interpolation-punctuation punctuation\">}</span></span><span class=\"token string\">?</span><span class=\"token interpolation\"><span class=\"token interpolation-punctuation punctuation\">${</span>tokenQuery<span class=\"token interpolation-punctuation punctuation\">}</span></span><span class=\"token template-punctuation string\">`</span></span><span class=\"token punctuation\">,</span> <span class=\"token punctuation\">{</span> <span class=\"token literal-property property\">method</span><span class=\"token operator\">:</span> <span class=\"token string\">'POST'</span> <span class=\"token punctuation\">}</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n<span class=\"token keyword\">const</span> info <span class=\"token operator\">=</span> <span class=\"token keyword\">await</span> response<span class=\"token punctuation\">.</span><span class=\"token function\">json</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span></code></pre></div>\n      </div>","headings":[{"value":"Using the REST API from JavaScript","depth":1},{"value":"Getting the Storage Info with JavaScript","depth":2}]},"contentItem":{"data":{"lastModified":"2025-09-10T14:16:09.000Z","enableToc":null,"disableLastModified":null,"tocMaxDepth":null,"requestLogin":false}},"siteConfig":{"enableToc":false,"disableLastModified":false,"tocMaxDepth":4}},"pageContext":{"matchPath":"","id":"0d4f8c01-a41c-5044-ae10-f3aa8ec24b5f__redocly content/cpm/developer/rest-api/how-to/javascript/","seo":{"title":"Using the REST API from JavaScript","description":null,"image":"","keywords":null,"jsonLd":null,"lang":null,"siteUrl":null},"pageId":"cpm/developer/rest-api/how-to/javascript/index.md","pageBaseUrl":"/cpm/developer/rest-api/how-to/javascript/index","type":"markdown","toc":{"enable":true,"maxDepth":4,"headings":[{"depth":1,"value":"Using the REST API from JavaScript","id":"using-the-rest-api-from-javascript"},{"depth":2,"value":"Getting the Storage Info with JavaScript","id":"getting-the-storage-info-with-javascript"}]},"data":{"title":""},"catalogInfo":null,"link":"/cpm/developer/rest-api/how-to/javascript/","sidebarName":"celonis","isLanding":false,"showPrevButton":null,"showNextButton":null,"apiVersions":null,"apiVersionId":null,"isDefaultApiVersion":null}},"staticQueryHashes":["1123603147","1302185487","1344209882","1398840060","1520077861","1975142765","2667623876","2950305614","3240152602","3743992808","561138138"]}