API.HttpService (v4)

Download OpenAPI specification:Download

Mightycall support: support@mightycall.com

MightyCall API (Application Programming Interface) exposes platform features to be used within 3rd party apps.

Tell us how you use the API and which additional methods you need to build integrations with a 3rd party apps. Send us your comments and feedback at support@mightycall.com

REST API Overview

API Capabilities

MightyCall API (Application Programming Interface) exposes platform features to be used within 3rd party apps.

Current API version can be used to:

  • Get list of calls in the account;
  • Get information about a particular call;
  • Get list of voicemails in the account;
  • Get information about a particular voicemail;
  • Get list of business phone numbers in the account;
  • Get user status;
  • Change user status;
  • Get user info;
  • Make an outgoing call via REST method;
  • Get, search, create, modify and delete your contacts.

Tell us how you use the API and which additional methods you need to build integrations with a 3rd party apps. Send us your comments and feedback at support@mightycall.com

How do I get access to the API methods?

API methods are available at the following endpoint: https://{prefix}.mightycall.com/{version}.

To access an API method you need to provide:

  • {api_key} - can be obtained in the MightyCall web app
  • {secret_key} - can be obtained in the MightyCall web app or user extension can be used
  • {auth_token} - authorization token which is generated based on {api_key} and {secret_key}
  • {version} - API version. Latest version is "v4"
  • {prefix} - environment prefix:
    • to test API methods or verify your integration use "sandbox"
    • to access API with your production account use "api"

{api_key}, {secret_key} and {auth_token} lifetime

  • {api_key} lifetime is not limited, it works until you either delete it or re-generate in the MightyCall web app;
  • {secret_key} lifetime is not limited, it works until you either disable it or re-generate in the MightyCall web app
  • {auth_token} lifetime is 24 hours and then it required re-generation.

All API methods except Ping require both {api_key} and {auth_token} to be provided and give you account-level access. Ping method can be called without {api_key} and {auth_token} to verify that API is up and running.

Integration principles and error handling

How do I get a "test" API Key?

How do I get a "production" API Key?

Integration principles and error handling

API should be accessed via secure SSL connection (HTTPS) using HTTP methods.

Each API method can return one of the following result codes:

  • 200 - operation executed successfully
  • 400 - wrong request or response is empty
  • 403 - no access to the method
  • 500 - operation execution failed

How do I get a "test" API Key?

You can use a shared test {api_key} to test API methods or verify your integration.

"x-api-key": "d8bd6a52-6051-42cb-817e-57096094bb9d"

How do I get a "production" API Key?

To use API with your production account you need to get a production {api_key}. You can get it in the MightyCall web app at https://panel.mightycall.com/mightycall/settings/api

Note, that API access is limited to certain subscription plan. Check https://mightycall.com/pricing/ for more details.

Are there any API usage limitations?

Each {api_key} is granted with 2500 API requests per 24 hours period. When you reach this limit your API access is blocked and you need to wait till the next 24 hours to begin.

What should I do if I have questions?

If case of any questions about the API you can contact us at support@mightycall.com

Authentication

Auth [POST /{version}/auth/token]

This method returns authorization token which is further used to access other API methods.

You can request authentication token in one of the following ways:

  • pass {api_key} as a client_id and {secret_key} as a client_secret, where {secret_key} is the user extension number (if sign-in by key switched off);
  • pass {api_key} as a client_id and {secret_key} as a client_secret, where {secret_key} is the key obtained in the MightyCall web app (if sign-in by key switched on);
  • pass {refresh_token} as refresh_token to re-generate existing token and reset the 24 hours lifetime timer.

Response example:

{
  "access_token": "TKnTuR83Ea63HZmhO63epxySZ8WC5fyz-_dQyLugHEO5516sQmMmMGMaBKgKs7Rau1Cz-r94NjntxEhkUPOrsMiml5p76DeYkXgSQSfhHsCi1cbg0wmQ5Ve-tHO56x--e-5R-YCiu3HJU76y_IQXOmZKF7_VU9srSNbN8m1gk7V0pU6ByrVUH4yrooDAN33vDY1IHga6fVR7yoLdC-QE_ejA1uYsk8yu5-6VAuRaJHF_3APWrvj18mIp8SdzvDozQcaqoZpLz5xs9AI9pPE2gimY4PeRc7bqLnzoT86lYkwqvsZvE1DePzav24PWUrhLm2YC0bxgRhcBXBstXCf2BivloFsvPH7BQ-4gEN08_bUFR0Vjq-zQysuu8hXDPRmmsqlgshHuodGuJeE-iKs0xxAKPPfFgy1pUxjKX_CG4XTjdcvIkzz_Ot6DJ8OHGhiGcQoeeHPaJohJEJbWc4lBMVur7NmznsiAcI64s-WsGJVkWV85EJWzuH1ghEdhWx98PCSg8hoTzOdI7G8ttR68l-Ow25B8Kyw5xnI1_EdggR3MHH8VyAKXp2WSJxsLUPIZ6Hk34sryKNrXmLgU6YuipO8-tiemdQa5fJSAxrFjTRnM1fTY82Raug11HPNj0oUJng-Uxx",
  "token_type": "bearer",
  "expires_in": 86399,
  "refresh_token": "fAutwPT6336x5PgI43z7xulpgDo+AbhoWtUg3XS2xyz="
}
  • Parameters

    • version (required, string) - API version (current is v4)
  • Request by api_key & secret key/extension number (application/x-www-form-urlencoded)

    • Headers

        x-api-key: {api_key}
        Content-Type: x-www-form-urlencoded
    • Body

        grant_type=client_credentials&
        client_id={api_key}&
        client_secret={secret_key}
  • Response 200 (application/json)

          {
              "access_token": "dQyLugHEO5516sQmMmMGMaBKgKs7Rau1Cz-r94NjntxEhkUPOrsMiml5p76DeYkXgSQSfhHsCi1cbg0wmQ5Ve-tHO56x--e-5R-YCiu3HJU76y_IQXOmZKF7_VU9srSNbN8m1gk7V0pU6ByrVUH4yrooDAN33vDY1IHga6fVR7yoLdC-QE_ejA1uYsk8yu5-6VAuRaJHF_3APWrvj18mIp8SdzvDozQcaqoZpLz5xs9AI9pPE2gimY4PeRc7bqLnzoT86lYkwqvsZvE1DePzav24PWUrhLm2YC0bxgRhcBXBstXCf2BivloFsvPH7BQ-4gEN08_bUFR0Vjq-zQysuu8hXDPRmmsqlgshHuodGuJeE-iKs0xxAKPPfFgy1pUxjKX_CG4XTjdcvIkzz_Ot6DJ8OHGhiGcQoeeHPaJohJEJbWc4lBMVur7NmznsiAcI64s-WsGJVkWV85EJWzuH1ghEdhWx98PCSg8hoTzOdI7G8ttR68l-Ow25B8Kyw5xnI1_EdggR3MHH8VyAKXp2WSJxsLUPIZ6Hk34sryKNrXmLgU6YuipO8-tiemdQa5fJSAxrFjTRnM1fTY82Raug11HPNj0oUJng-Uww",
              "token_type": "bearer",
              "expires_in": 86399,
              "refresh_token": "fAutwPT123456x5PgI43z7xulpgDo+AbhoWtUg3XS2jBE="
          }
  • Request by refresh_token (application/x-www-form-urlencoded)

    • Headers

        x-api-key: {api_key}
        Content-Type: x-www-form-urlencoded
    • Body

        grant_type=refresh_token&
        refresh_token={refresh_token}
  • Response 200 (application/json)

          {
              "access_token": "ev123vo%lk456ves789evev0-dQyLugHEO5516sQmMmMGMaBKgKs7Rau1Cz-r94NjntxEhkUPOrsMiml5p76DeYkXgSQSfhHsCi1cbg0wmQ5Ve-tHO56x--e-5R-YCiu3HJU76y_IQXOmZKF7_VU9srSNbN8m1gk7V0pU6ByrVUH4yrooDAN33vDY1IHga6fVR7yoLdC-QE_ejA1uYsk8yu5-6VAuRaJHF_3APWrvj18mIp8SdzvDozQcaqoZpLz5xs9AI9pPE2gimY4PeRc7bqLnzoT86lYkwqvsZvE1DePzav24PWUrhLm2YC0bxgRhcBXBstXCf2BivloFsvPH7BQ-4gEN08_bUFR0Vjq-zQysuu8hXDPRmmsqlgshHuodGuJeE-iKs0xxAKPPfFgy1pUxjKX_CG4XTjdcvIkzz_Ot6DJ8OHGhiGcQoeeHPaJohJEJbWc4lBMVur7NmznsiAcI64s-WsGJVkWV85EJWzuH1ghEdhWx98PCSg8hoTzOdI7G8ttR68l-Ow25B8Kyw5xnI1_EdggR3MHH8VyAKXp2WSJxsLUPIZ6Hk34sryKNrXmLgU6YuipO8-tiemdQa5fJSAxrFjTRnM1fTY82Raug11HPNj0oUJng-Uww",
              "token_type": "bearer",
              "expires_in": 86399,
              "refresh_token": "fAutwPT123456x5%PgI43z7xulpgDo+AbhoWtUg3XS2jBE="
          }

Auth [POST /{version}/auth/token]

This method returns authorization token which is further used to access other API methods.

You can request authentication token in one of the following ways:

  • pass {api_key} as a client_id and {secret_key} as a client_secret, where {secret_key} is the user extension number (if sign-in by key switched off);
  • pass {api_key} as a client_id and {secret_key} as a client_secret, where {secret_key} is the key obtained in the MightyCall web app (if sign-in by key switched on);
  • pass {refresh_token} as refresh_token to re-generate existing token and reset the 24 hours lifetime timer.

Response example:

{
  "access_token": "TKnTuR83Ea63HZmhO63epxySZ8WC5fyz-_dQyLugHEO5516sQmMmMGMaBKgKs7Rau1Cz-r94NjntxEhkUPOrsMiml5p76DeYkXgSQSfhHsCi1cbg0wmQ5Ve-tHO56x--e-5R-YCiu3HJU76y_IQXOmZKF7_VU9srSNbN8m1gk7V0pU6ByrVUH4yrooDAN33vDY1IHga6fVR7yoLdC-QE_ejA1uYsk8yu5-6VAuRaJHF_3APWrvj18mIp8SdzvDozQcaqoZpLz5xs9AI9pPE2gimY4PeRc7bqLnzoT86lYkwqvsZvE1DePzav24PWUrhLm2YC0bxgRhcBXBstXCf2BivloFsvPH7BQ-4gEN08_bUFR0Vjq-zQysuu8hXDPRmmsqlgshHuodGuJeE-iKs0xxAKPPfFgy1pUxjKX_CG4XTjdcvIkzz_Ot6DJ8OHGhiGcQoeeHPaJohJEJbWc4lBMVur7NmznsiAcI64s-WsGJVkWV85EJWzuH1ghEdhWx98PCSg8hoTzOdI7G8ttR68l-Ow25B8Kyw5xnI1_EdggR3MHH8VyAKXp2WSJxsLUPIZ6Hk34sryKNrXmLgU6YuipO8-tiemdQa5fJSAxrFjTRnM1fTY82Raug11HPNj0oUJng-Uxx",
  "token_type": "bearer",
  "expires_in": 86399,
  "refresh_token": "fAutwPT6336x5PgI43z7xulpgDo+AbhoWtUg3XS2xyz="
}
  • Parameters

    • version (required, string) - API version (current is v4)
  • Request by api_key & secret key/extension number (application/x-www-form-urlencoded)

    • Headers

        x-api-key: {api_key}
        Content-Type: x-www-form-urlencoded
    • Body

        grant_type=client_credentials&
        client_id={api_key}&
        client_secret={secret_key}
  • Response 200 (application/json)

          {
              "access_token": "dQyLugHEO5516sQmMmMGMaBKgKs7Rau1Cz-r94NjntxEhkUPOrsMiml5p76DeYkXgSQSfhHsCi1cbg0wmQ5Ve-tHO56x--e-5R-YCiu3HJU76y_IQXOmZKF7_VU9srSNbN8m1gk7V0pU6ByrVUH4yrooDAN33vDY1IHga6fVR7yoLdC-QE_ejA1uYsk8yu5-6VAuRaJHF_3APWrvj18mIp8SdzvDozQcaqoZpLz5xs9AI9pPE2gimY4PeRc7bqLnzoT86lYkwqvsZvE1DePzav24PWUrhLm2YC0bxgRhcBXBstXCf2BivloFsvPH7BQ-4gEN08_bUFR0Vjq-zQysuu8hXDPRmmsqlgshHuodGuJeE-iKs0xxAKPPfFgy1pUxjKX_CG4XTjdcvIkzz_Ot6DJ8OHGhiGcQoeeHPaJohJEJbWc4lBMVur7NmznsiAcI64s-WsGJVkWV85EJWzuH1ghEdhWx98PCSg8hoTzOdI7G8ttR68l-Ow25B8Kyw5xnI1_EdggR3MHH8VyAKXp2WSJxsLUPIZ6Hk34sryKNrXmLgU6YuipO8-tiemdQa5fJSAxrFjTRnM1fTY82Raug11HPNj0oUJng-Uww",
              "token_type": "bearer",
              "expires_in": 86399,
              "refresh_token": "fAutwPT123456x5PgI43z7xulpgDo+AbhoWtUg3XS2jBE="
          }
  • Request by refresh_token (application/x-www-form-urlencoded)

    • Headers

        x-api-key: {api_key}
        Content-Type: x-www-form-urlencoded
    • Body

        grant_type=refresh_token&
        refresh_token={refresh_token}
  • Response 200 (application/json)

          {
              "access_token": "ev123vo%lk456ves789evev0-dQyLugHEO5516sQmMmMGMaBKgKs7Rau1Cz-r94NjntxEhkUPOrsMiml5p76DeYkXgSQSfhHsCi1cbg0wmQ5Ve-tHO56x--e-5R-YCiu3HJU76y_IQXOmZKF7_VU9srSNbN8m1gk7V0pU6ByrVUH4yrooDAN33vDY1IHga6fVR7yoLdC-QE_ejA1uYsk8yu5-6VAuRaJHF_3APWrvj18mIp8SdzvDozQcaqoZpLz5xs9AI9pPE2gimY4PeRc7bqLnzoT86lYkwqvsZvE1DePzav24PWUrhLm2YC0bxgRhcBXBstXCf2BivloFsvPH7BQ-4gEN08_bUFR0Vjq-zQysuu8hXDPRmmsqlgshHuodGuJeE-iKs0xxAKPPfFgy1pUxjKX_CG4XTjdcvIkzz_Ot6DJ8OHGhiGcQoeeHPaJohJEJbWc4lBMVur7NmznsiAcI64s-WsGJVkWV85EJWzuH1ghEdhWx98PCSg8hoTzOdI7G8ttR68l-Ow25B8Kyw5xnI1_EdggR3MHH8VyAKXp2WSJxsLUPIZ6Hk34sryKNrXmLgU6YuipO8-tiemdQa5fJSAxrFjTRnM1fTY82Raug11HPNj0oUJng-Uww",
              "token_type": "bearer",
              "expires_in": 86399,
              "refresh_token": "fAutwPT123456x5%PgI43z7xulpgDo+AbhoWtUg3XS2jBE="
          }

Calls

List calls

This method can return:

  • list of calls based on parameters '''{?pageSize,skip,startUtc,endUtc,callFilter,customFilter }'''
  • information about a particular call based on it’s ID { id }

Request headers:

Authorization: Bearer {auth_token}
x-api-key: {api_key}

Response headers:

Content-Type: application/json

Parameters:

/{prefix}/{version}/calls/{id}?pageSize=..&skip=..&startUtc=..&endUtc=..&callFilter=..&customFilter=..

If no calls found by specified criteria or there is no any call available for the authenticated user, an empty data will be returned as well as Http status 200 OK:

{
    "data": {
        "calls": [],
        "total": 0
    },
    "isSuccess": true
}
query Parameters
pageSize
integer <int32> [ 1 .. 2147483647 ]

Number of calls to return Default is 10 items per one page.

skip
integer <int32> [ 0 .. 2147483647 ]

number of calls to skip.

startUtc
string <date-time>

Start of the date/time calls interval at yyyy-MM-ddThh:mm:ss format. By default is 'now - 1 day'.

endUtc
string <date-time>

End of the date/time calls interval in yyyy-MM-ddThh:mm:ss format. By default it is the current date and time ('now').

callFilter
string
Enum: "Incoming" "Outgoing" "InOutgoing" "Connected" "Missed" "Canceled" "Dropped" "Voicemail" "InternalOnly" "CallbackWidget"

Calls filter (multiple values supported).

  • Incoming - incoming call;
  • Outgoing - outgoing call;
  • InOutgoing - incoming or outgoing call;
  • Connected - connected call;
  • Missed - missed call;
  • Canceled - cancelled call;
  • Dropped - dropped call;
  • Voicemail - voicemail;
  • InternalOnly - internal call;
  • CallbackWidget - callback widget call.
customFilter
string

Calls search string.

extension
string

The extension number.

Responses

200

OK. In case of success, the response contains list of the available calls.

400

Bad Request. Some request parameter is invalid.

get/calls
https://api-demo-lb.mightycall.com//v4/api/calls

Response samples

Content type
Copy
Expand all Collapse all
{
  • "data":
    {
    },
  • "isSuccess": true
}

Get call

Returns call object by its unique identifier:

 GET /{version}/calls/[call guid identifier with dashes]

Request headers:

 Authorization: Bearer {auth_token}
 x-api-key: {api_key}

Response headers:

 Content-Type: application/json

Example:

Request:

 GET /{version}/calls/7e734dc1-544d-4f04-8ccc-8bd5b197a88c;

Response:

Status: 200OK

 {
    "id":"7e734dc1-544d-4f04-8ccc-8bd5b197a88c",
    "caller":{
       "name":"u2 u2",
       "extension":"101"
    },
    "called":[
       {
          "isConnected":true,
          "name":"akmightycall4 akmightycall4",
          "extension":"100"
       },
       {
          "isConnected":false,
          "name":"u3 u3",
          "extension":"102",
          "phone":"+75551112235"
       }
    ],
    "businessNumber":"+74950152729",
    "dateTimeUtc":"2018-06-05T13:38:29.522Z",
    "duration":"23066",
    "direction":"Outgoing",
    "callStatus":"Connected",
    "callRecord":{
       "fileName":"records/T1U9YWttaWdodHljYWxfRjk1MjJFM0RFQjJGNDJBM0JDRDk2MjdCNTFBNDM0QTksT1U9WWFuZGV4LE9VPUluZnJhdGVsLERDPXJ1LERDPW1pZ2h0eWNhbGwsREM9ZGV20/7e734dc1-544d-4f04-8ccc-8bd5b197a88c.wav",
       "uri": "/mightycall/files/callrecord_20180605_1338_u2_u2.wav?recordid=[record-id]"
 }
path Parameters
id
required
string

Call id unique identifier, in Guid format: 36 symbols with dashes, e.g. '7e734dc1-544d-4f04-8ccc-8bd5b197a88c'

Responses

200

OK. In case of success, the response contains list of the available calls.

400

Bad Request. Returns error if call with call id is not found or has invalid format.

get/calls/{id}
https://api-demo-lb.mightycall.com//v4/api/calls/{id}

Response samples

Content type
Copy
Expand all Collapse all
{
  • "data":
    {
    },
  • "isSuccess": true
}

Make call

Method allows to start an outgoing call from one of the business numbers of authorized user to an external number. This method can return:

  • information about a particular call based on it’s ID {id}

Request headers:

Content-Type: application/json
Authorization: Bearer {auth_token}
x-api-key: {api_key}

Response headers:

Content-Type: application/json
Request Body schema:
from
required
string ^\+?(?:[0-9] ?){6,14}[0-9]$

E164 international number format

to
required
string ^\+?(?:[0-9] ?){2,15}$

E164 international number format

Responses

200

OK. Returns newly created call object.

400

Bad Request. Some request parameter is invalid: at least one of the input phone numbers is invalid number.

post/calls/makecall
https://api-demo-lb.mightycall.com//v4/api/calls/makecall

Request samples

Content type
Copy
Expand all Collapse all
{
  • "from": "+75551112233",
  • "to": "+74950152729"
}

Response samples

Content type