{
    "componentChunkName": "component---src-templates-doc-page-js",
    "path": "/docs/en/telephony/calls_api/",
    "result": {"data":{"site":{"siteMetadata":{"title":"Gatsby-doc-engine"}},"markdownRemark":{"id":"79caed8a-9296-55be-b528-b91199e36edc","excerpt":"Calls API The JAICP platform provides the Calls API to work with telephony. The API provides the following capabilities: Adding phone numbers with parameters to…","html":"<h1>Calls API</h1>\n<hr>\n<p>The JAICP platform provides the Calls API to work with telephony.</p>\n<p>The API provides the following capabilities:</p>\n<ul>\n<li>Adding phone numbers with parameters to the broadcast.</li>\n<li>Obtaining a report by the call task ID.</li>\n<li>Obtaining a report by the phone number for a single broadcast.</li>\n</ul>\n<p>Before starting your work with the Calls API, you need to:</p>\n<ol>\n<li><a href=\"/1.10.3/docs/en/telephony/telephony_setup\">Configure telephony</a>.</li>\n<li><a href=\"/1.10.3/docs/en/telephony/telephone_channel\">Connect a telephone channel</a>.</li>\n<li><a href=\"/1.10.3/docs/en/telephony/call_tasks\">Create a voice broadcast</a>.</li>\n</ol>\n</br>\n<h3>API methods</h3>\n<p class='warn'><a href=https://help.just-ai.com/docs/api/calls_api/ target=\"_blank\" rel=\"noopener noreferrer\">A detailed description of the Calls API: methods, request parameters, response formats, examples, returned errors ></a></p>\n<p class='tip'>Access control is checked by the broadcast token only.</p>\n<p>The API provides the following methods:</p>\n<table>\n<thead>\n<tr>\n<th align=\"left\">Method</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td align=\"left\"><code class=\"language-text\">POST https://&lt;host_name>/api/calls/campaign/{token}/addPhones</code></td>\n<td>Adding phone numbers with parameters to the broadcast.</td>\n</tr>\n<tr>\n<td align=\"left\"><code class=\"language-text\">POST https://&lt;host_name>/api/calls/campaign/{token}/getReport</code></td>\n<td>Obtaining a <code class=\"language-text\">JSON</code> report via a call task ID or via a phone number.</td>\n</tr>\n<tr>\n<td align=\"left\"><code class=\"language-text\">POST https://&lt;host_name>/api/calls/campaign/{token}/callJob/cancel</code></td>\n<td>Canceling new calls to a phone number or call task ID. </br> </br> Please note that you can only cancel calls to numbers that are added using the Calls API.</td>\n</tr>\n<tr>\n<td align=\"left\"><code class=\"language-text\">POST https://&lt;host_name>/api/calls/campaign/{token}/control/start</code></td>\n<td>Starting a new voice broadcast.</td>\n</tr>\n<tr>\n<td align=\"left\"><code class=\"language-text\">POST https://&lt;host_name>/api/calls/campaign/{token}/control/pause</code></td>\n<td>Pausing a voice broadcast.</td>\n</tr>\n<tr>\n<td align=\"left\"><code class=\"language-text\">POST https://&lt;host_name>/api/calls/campaign/{token}/control/resume</code></td>\n<td>Resuming a paused voice broadcast.</td>\n</tr>\n<tr>\n<td align=\"left\"><code class=\"language-text\">POST https://&lt;host_name>/api/calls/campaign/{token}/control/stop</code></td>\n<td>Stopping a voice broadcast.</td>\n</tr>\n</tbody>\n</table>\n</br>\n<ul>\n<li>You can copy <code class=\"language-text\">host_name</code> from the address bar; it is formatted as follows: <code class=\"language-text\"> http://&lt;host_name>.just-ai.com/</code>.</li>\n</ul>\n<p>For example, for <code class=\"language-text\">https://zb04.just-ai.com/</code> the method for phone number addition will have the following form:</p>\n<div class=\"gatsby-highlight\" data-language=\"text\"><pre class=\"language-text\"><code class=\"language-text\">https://zb04.just-ai.com/api/calls/campaign/123456.789.mBoMyfZLZqKHIPKjFjWYfRw9hgfIV9InFC4bHGVw5ND/addPhones</code></pre></div>\n</br>\n<ul>\n<li>The token is configured when creating a voice broadcast in the platform. To copy the token, navigate to the broadcast list > click the <span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 19px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 157.89473684210526%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAgCAYAAAASYli2AAAACXBIWXMAABJ0AAASdAHeZh94AAABXElEQVRIx+1Wy4qDQBDM//9KDPFxEnIRjJhDElRQQYSAB8mbXIzio5dqUBbJLnE0twwU08hMTU9X0eOsaRqaErMvYYe6rru4P16teStDbKiqip7PJ2VZxkBcluVLsrcIz+czrddrMgyDYZompWnKBw0mxKYgCEhRFJJlmSFJErmuy9n+vv7bhGEYkqqqTAbixWJBnueJEyLDSQnjOKblcslEAK6MrPM8H04IUbDxfr/T9Xpl3G43Vnqwyu2Gv4awDx+PBzmOQ5ZlsX32+z1nKmwb1FDTtK6GqKdwDUHo+37nQ8yjfdi3zWjCKIqYrLUMZmQtbBsIsNvtaLPZkG3btN1u6XQ6DRflY7YpioIulwsdj0cGYiFjt4SHw4FFQf3m8znXE3XFQcLtq98cJrXN6G4zaT9EDSHEarXqWpiu65QkCb8rQqIgS5gYygKI8U24ffWf0v/WfH9FpiH8Adddpszp0qa5AAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"Click on &quot;copy&quot; icon to copy the token\"\n        title=\":size=15\"\n        src=\"/1.10.3/static/77a5234f2b938597021d773f03225cd1/1fe13/Screenshot_3.png\"\n        srcset=\"/1.10.3/static/77a5234f2b938597021d773f03225cd1/1fe13/Screenshot_3.png 19w\"\n        sizes=\"(max-width: 19px) 100vw, 19px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n        decoding=\"async\"\n      />\n    </span> icon next to the broadcast name > <em>Copy API token</em>.</li>\n</ul>\n<blockquote>\n<p>When adding a phone number to a specific broadcast queue, a call task with a unique ID is created. Here, if this phone number is added to this broadcast again, a new call task with another ID will be created.</p>\n</blockquote>\n<p class='tip'>Note that the report about the calls completed will contain information about call date, duration and result as well as all data written to the script by the method <code class=\"language-text\">$dialer.reportData($header, $value, $order)</code>.</p>\n</br>\n<h3>Defining a call policy via the Calls API</h3>\n<p class='warn'>You can configure custom calling parameters when you use API to add a number to a calling campaign.</p>\n<p><a href=\"https://help.just-ai.com/docs/api/calls_api/#/PublicCallsApi/addPhones\" target=\"_blank\" rel=\"noopener noreferrer\">To do so, pass the <code class=\"language-text\">CallJobParameters</code> parameters in the query body when you invoke the <code class=\"language-text\">addPhones</code> method</a>.</p>\n<p>If no parameters are passed, the number is added to the queue and calls are made as usual. If you add a custom policy number, it gets higher priority than other numbers according to the calling policy.</p>\n<p class='warn'><a href=/1.10.3/docs/en/telephony/call_policy  >Learn more about calling policies</a></p>\n</br>\n<h3>Call statuses</h3>\n<p class='warn'>In the API response, the field <code class=\"language-text\">jobStatus</code> describes the status of the number for each call at the time of report generation.</p>\n<table>\n<thead>\n<tr>\n<th>Значение поля</th>\n<th align=\"left\">Описание</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code class=\"language-text\">longСallWithResult</code></td>\n<td align=\"left\">A result has been set after the call completion.</td>\n</tr>\n<tr>\n<td><code class=\"language-text\">longCallWithNoResult</code></td>\n<td align=\"left\">No result has been set after the call completion.</td>\n</tr>\n<tr>\n<td><code class=\"language-text\">noAnswer</code></td>\n<td align=\"left\">No subscriber response has been detected for all call attempts.</td>\n</tr>\n<tr>\n<td><code class=\"language-text\">planned</code></td>\n<td align=\"left\">The call is currently queued, for example, because all the lines are busy now.</td>\n</tr>\n<tr>\n<td><code class=\"language-text\">notDone</code></td>\n<td align=\"left\">This status will be set if the broadcast has been completed but no calls were made. For example, the broadcast was completed manually.</td>\n</tr>\n<tr>\n<td><code class=\"language-text\">inProcess</code></td>\n<td align=\"left\">Call attempt or conversation with a subscriber is in progress.</td>\n</tr>\n<tr>\n<td><code class=\"language-text\">onRetry</code></td>\n<td align=\"left\">A retry.</td>\n</tr>\n<tr>\n<td><code class=\"language-text\">canceled</code></td>\n<td align=\"left\">The status will be set if the calls were canceled via Calls API.</td>\n</tr>\n<tr>\n<td><code class=\"language-text\">nonexistentNumber</code></td>\n<td align=\"left\">The status will be set if the call is made to a non-existent phone number.</td>\n</tr>\n</tbody>\n</table>","frontmatter":{"title":"","description":null},"headings":[{"value":"Calls API"}]}},"pageContext":{"slug":"/docs/en/telephony/calls_api/","previous":{"fields":{"slug":"/docs/en/telephony/lists_of_numbers/"},"frontmatter":{"title":"","description":null}},"next":{"fields":{"slug":"/docs/en/telephony/call_tasks/"},"frontmatter":{"title":"","description":null}}}},
    "staticQueryHashes": ["1209419333"]}