FlashСall API

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 header or an X-Authorization argument with a connection token in the AccessKey token format,

For example, the title
POST /apps/activate HTTP/1.1
Host: https://cpaas.mittoapi.net/api
X-Authorization: AccessKey d8ac9959r12b43545da9034,

either by parameter
POST https://cpaas.mittoapi.net/api/apps/activate?X-Authorization=AccessKey d8ac9959r12b43545da9034

Response format

The JSON scheme of any response contains a string type status parameter with the following values:

Status ValueDescription
okNo errors
invalidAccessKeyErrorInvalid AccessKey
requiredJsonErrorThe request body requires JSON
invalidSchemeErrorInvalid JSON scheme
invalidDataErrorInput data error
prohibitedForAppErrorProhibited for this application
prohibitedForServiceErrorProhibited for this service
rpcErrorCommunication error

For example:

    {
        …
        “status”: “ok”
        ....
    }

FlashCall requests

POST https://cpaas.mittoapi.net/api/apps/flash/calls/flash
HTTP Basic
Authorization: token

Parameters in the body, json

    {
        "number": "791791367878",
        "code": 1234,
        "timeout": 60000, 
    } 
ParameterDescription
numberPhone number in e.164 format
codeCode, 4e characters
timeoutMaximum call time in ms

Answer:

In case of successful sending, RequestId is returned — the ID of the message on the partner’s side, which is then returned to the callback.

Example of a successful response:

    {
        "requestId": XXXXXX
        "from": "79179136787"
    }

Example of an unsuccessful response:

    {
        "errorCode" : 1,
        "errorReason" : "Authentication required"
    }

Description of error codes

errorCodeerrorReasonDescription
1 НТТP 401Authentication requiredInvalid authentication token
2 HTTP 400Inactive accountInactive account. Contact support
4 HTTP 429Too many requestsToo many requests in a short period of time
5 HTTP 401Inactive tokenInactive token
6 HTTP 403Insufficient fundsLow balance, unable to complete the request
10 HTTP 400Invalid requestIncorrectly formed request
11 HTTP 400Invalid numberInvalid number format. The number must be in the format (E.164).
16 HTTP 400Sender not allowedSender id is invalid for this type of request

Getting statuses

Getting statuses should be configured via Callback

Parameters in the callback

ParameterDescription
requestIdThe unique identifier of the request on the partner’s side
numberSubscriber’s number
statusStatus (shown in the table below)
timestampThe time of the status change in unixtime format
appKeyThe API key of the application

Statuses comparison

Statuses that a Partner can returnDescription of the Partner statusThe corresponding status is Message_state
ANSWEREDThe call came, the caller picked up the phoneDELIVERED
TERMINATEDThe call came, the subscriber did not pick up the phone (the call was interrupted after the ttl or by command)
BUSY_HEREThe call came, the caller dropped the call
REJECTEDThe call cannot be made, for example, if the number is still occupied by another call or another SIP errorUNDELIVERED
UNAVAILABLEThe subscriber is unavailable, the phone is turned off
FORBIDDENIt is returned when the anti-fraud is triggered
On this page