{"id":323,"date":"2022-10-11T20:05:21","date_gmt":"2022-10-11T17:05:21","guid":{"rendered":"http:\/\/192.168.200.3:8082\/?page_id=323"},"modified":"2025-02-10T07:06:16","modified_gmt":"2025-02-10T04:06:16","slug":"flash-call-api","status":"publish","type":"page","link":"https:\/\/docs.cpaas.mittoapi.net\/?page_id=323","title":{"rendered":"Flash\u0421all API"},"content":{"rendered":"\n<h2 id=\"format\" class=\"anchor\">Interaction format<\/h2>\n\n\n\n<p style=\"font-size:15px\">API requests are made over the HTTP protocol. Input and output data structures are transmitted in the request and response body in JSON format.<\/p>\n\n\n\n<h2 id=\"auth\" class=\"anchor\">Authorization<\/h2>\n\n\n\n<p style=\"font-size:15px\">Most HTTP API calls require authentication and authorization procedures that link API calls to the required applications in your account.<\/p>\n\n\n\n<p style=\"font-size:15px\">To do this, each request must contain a header or an X-Authorization argument with a connection token in the AccessKey token format,<\/p>\n\n\n\n<p style=\"font-size:15px\">For example, the title<br>POST \/apps\/activate HTTP\/1.1<br>Host: https:\/\/cpaas.mittoapi.net\/api<br>X-Authorization: AccessKey d8ac9959r12b43545XXXXX,<\/p>\n\n\n\n<p style=\"font-size:15px\">either by parameter<br>POST https:\/\/cpaas.mittoapi.net\/api\/apps\/activate?X-Authorization=AccessKey d8ac9959r12b43545XXXXX<\/p>\n\n\n\n<h2 id=\"format-quest\" class=\"anchor\">Response format<\/h2>\n\n\n\n<p style=\"font-size:15px\">The JSON scheme of any response contains a string type status parameter with the following values:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Status Value<\/th><th><strong>Description<\/strong><\/th><\/tr><\/thead><tbody><tr><td>ok<\/td><td>No errors<\/td><\/tr><tr><td>invalidAccessKeyError<\/td><td>Invalid AccessKey<\/td><\/tr><tr><td>requiredJsonError<\/td><td>The request body requires JSON<\/td><\/tr><tr><td>invalidSchemeError<\/td><td>Invalid JSON scheme<\/td><\/tr><tr><td>invalidDataError<\/td><td>Input data error<\/td><\/tr><tr><td>prohibitedForAppError<\/td><td>Prohibited for this application<\/td><\/tr><tr><td>prohibitedForServiceError<\/td><td>Prohibited for this service<\/td><\/tr><tr><td>rpcError<\/td><td>Communication error<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p style=\"font-size:15px\">For example:<\/p>\n\n\n\n<pre class=\"wp-block-code\" style=\"font-size:15px\"><code>    {\n        \u2026\n        \u201cstatus\u201d: \u201cok\u201d\n        ....\n    }<\/code><\/pre>\n\n\n\n<h2 id=\"flashcall-requests\" class=\"anchor\">FlashCall requests<\/h2>\n\n\n\n<p style=\"font-size:15px\">POST https:\/\/cpaas.mittoapi.net\/api\/apps\/flash\/calls\/flash<br>HTTP Basic<br>Authorization: token<\/p>\n\n\n\n<p style=\"font-size:15px\">Parameters in the body, json<\/p>\n\n\n\n<pre class=\"wp-block-code\" style=\"font-size:15px\"><code>    {\n        \"number\": \"791791367878\",\n        \"code\": 1234,\n        \"timeout\": 60000, \n    } <\/code><\/pre>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th><strong>Parameter<\/strong><\/th><th><strong>Description<\/strong><\/th><\/tr><\/thead><tbody><tr><td>number<\/td><td>Phone number in e.164 format<\/td><\/tr><tr><td>code<\/td><td>Code, 4e characters<\/td><\/tr><tr><td>timeout<\/td><td>Maximum call time in ms<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2>Answer:<\/h2>\n\n\n\n<p style=\"font-size:15px\">In case of successful sending, RequestId is returned \u2014 the ID of the message on the partner&#8217;s side, which is then returned to the callback.<\/p>\n\n\n\n<h2>Example of a successful response:<\/h2>\n\n\n\n<pre class=\"wp-block-code\" style=\"font-size:15px\"><code>    {\n        \"requestId\": XXXXXX\n        \"from\": \"79179136787\"\n    }<\/code><\/pre>\n\n\n\n<h2>Example of an unsuccessful response:<\/h2>\n\n\n\n<pre class=\"wp-block-code\" style=\"font-size:15px\"><code>    {\n        \"errorCode\" : 1,\n        \"errorReason\" : \"Authentication required\"\n    }<\/code><\/pre>\n\n\n\n<h2 id=\"status-error-codes\" class=\"anchor\">Description of error codes<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th><strong>errorCode<\/strong><\/th><th><strong>errorReason<\/strong><\/th><th><strong>Description<\/strong><\/th><\/tr><\/thead><tbody><tr><td>1 \u041d\u0422\u0422P 401<\/td><td>Authentication required<\/td><td>Invalid authentication token<\/td><\/tr><tr><td>2 HTTP 400<\/td><td>Inactive account<\/td><td>Inactive account. Contact support<\/td><\/tr><tr><td>4 HTTP 429<\/td><td>Too many requests<\/td><td>Too many requests in a short period of time<\/td><\/tr><tr><td>5 HTTP 401<\/td><td>Inactive token<\/td><td>Inactive token<\/td><\/tr><tr><td>6 HTTP 403<\/td><td>Insufficient funds<\/td><td>Low balance, unable to complete the request<\/td><\/tr><tr><td>10 HTTP 400<\/td><td>Invalid request<\/td><td>Incorrectly formed request<\/td><\/tr><tr><td>11 HTTP 400<\/td><td>Invalid number<\/td><td>Invalid number format. The number must be in the format (E.164).<\/td><\/tr><tr><td>16 HTTP 400<\/td><td>Sender not allowed<\/td><td>Sender id is invalid for this type of request<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 id=\"obtaining-statuses\" class=\"anchor\">Getting statuses<\/h2>\n\n\n\n<p style=\"font-size:15px\">Getting statuses should be configured via Callback<\/p>\n\n\n\n<h2 id=\"callback-parametrs\" class=\"anchor\">Parameters in the callback<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th><strong>Parameter<\/strong><\/th><th><strong>Description<\/strong><\/th><\/tr><\/thead><tbody><tr><td>requestId<\/td><td>The unique identifier of the request on the partner&#8217;s side<\/td><\/tr><tr><td>number<\/td><td>Subscriber&#8217;s number<\/td><\/tr><tr><td>status<\/td><td>Status (shown in the table below)<\/td><\/tr><tr><td>timestamp<\/td><td>The time of the status change in unixtime format<\/td><\/tr><tr><td>appKey<\/td><td>The API key of the application<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 id=\"status-comparison\" class=\"anchor\">Statuses comparison<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th><strong>Statuses that a Partner can return<\/strong><\/th><th><strong>Description of the Partner status<\/strong><\/th><th><strong>The corresponding status is Message_state<\/strong><\/th><\/tr><\/thead><tbody><tr><td>ANSWERED<\/td><td>The call came, the caller picked up the phone<\/td><td>DELIVERED<\/td><\/tr><tr><td>TERMINATED<\/td><td>The call came, the subscriber did not pick up the phone (the call was interrupted after the ttl or by command)<\/td><td><\/td><\/tr><tr><td>BUSY_HERE<\/td><td>The call came, the caller dropped the call<\/td><td><\/td><\/tr><tr><td>REJECTED<\/td><td>The call cannot be made, for example, if the number is still occupied by another call or another SIP error<\/td><td>UNDELIVERED<\/td><\/tr><tr><td>UNAVAILABLE<\/td><td>The subscriber is unavailable, the phone is turned off<\/td><td><\/td><\/tr><tr><td>FORBIDDEN<\/td><td>It is returned when the anti-fraud is triggered<\/td><td><\/td><\/tr><\/tbody><\/table><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Interaction format API requests are made over the HTTP protocol. Input and output data structures are transmitted in the request and response body in JSON format. Authorization Most HTTP API calls require authentication and authorization procedures that link API calls to the required applications in your account. To do this, each request must contain a <a href=\"https:\/\/docs.cpaas.mittoapi.net\/?page_id=323\" class=\"more-link\">&#8230;<span class=\"screen-reader-text\">  Flash\u0421all API<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"tpl\/http-content.php","meta":[],"acf":[],"_links":{"self":[{"href":"https:\/\/docs.cpaas.mittoapi.net\/index.php?rest_route=\/wp\/v2\/pages\/323"}],"collection":[{"href":"https:\/\/docs.cpaas.mittoapi.net\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/docs.cpaas.mittoapi.net\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/docs.cpaas.mittoapi.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.cpaas.mittoapi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=323"}],"version-history":[{"count":14,"href":"https:\/\/docs.cpaas.mittoapi.net\/index.php?rest_route=\/wp\/v2\/pages\/323\/revisions"}],"predecessor-version":[{"id":4252,"href":"https:\/\/docs.cpaas.mittoapi.net\/index.php?rest_route=\/wp\/v2\/pages\/323\/revisions\/4252"}],"wp:attachment":[{"href":"https:\/\/docs.cpaas.mittoapi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=323"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}