NAV

Introduction

Welcome to Innocalls APIs You can use our APIs to make voice calls with any call flow you can think of.

Authentication

Innocalls voice calls uses bearer tokens to authenticate requests


Bearer ds76sd76XXXXXXXXXXXXXXXXXXXXXXXX

To authorize:

        
        curl --location --request GET "https://ecommerce.innocalls.com/" \
      --header "Content-Type: application/x-www-form-urlencoded" \
      --header "Authorization: Bearer ${TOKEN}" \

        
        

Order Confirmation

Confirmation

curl --location --request POST 'https://ecommerce.innocalls.com/api/v1/order/confirmation' \
--header "Authorization: Bearer ${TOKEN}" \
--form 'phone=20112XXXXX' \
--form 'call_flow_id=3815e7b721XXXXXXXXXXXXXXX' \
--form 'order_number=123456789' \
--form 'tries= 2' \
--form 'try_delay=50' \
--form 'order_cost=2300' \
--form 'items_count=2'

  

The above command returns JSON structured like this:


{
    "status": 200,
    "success": true,
    "data": {
        "message": "Call in queue",
    }
}
            

HTTP Request

POST https://ecommerce.innocalls.com/api/v1/order/confirmation

Query Parameters

Parameter Value Required
phone Phone number With international country code : ['EGP'=2,'USA'=1,'SA'=966 ] True
call_flow_id Call flow id True
order_number Order number True
tries How many retries needed if no response or busy False
try_delay How many minutes to wait before calling again False
items_count Cart items quantity False
order_cost Total order price False
type order_number is the default value if not sent False
items_count , order_cost might be required according to call flow type

Call Bridging

Bridging

curl --location --request POST 'https://api.bridge.innocalls.com/api/v1/call/bridge' \
--header "Authorization: Bearer ${TOKEN}" \
--form 'call_flow_id=XXXXXXXXXXXXXXXXX' \
--form 'first_callee_number=20112XXXXX' \
--form 'first_callee_name=first name' \
--form 'second_callee_number=20112XXXXX' \
--form 'second_callee_name= second name' \
--form 'call_time=2020-04-23 00:57:00' \
--form 'duration=2'

  

The above command returns JSON structured like this:


{
    "status": 200,
    "success": true,
    "data": {
        "call_id": "f2281763-e58a-4817-bc34-4b120c230cfbas"
    }
}
            

You can schedule calls by adding call_time parameter

HTTP Request

POST https://api.bridge.innocalls.com/api/v1/call/bridge

Query Parameters

Parameter Value Required
call_flow_id The call flow used to send this call True
first_callee_number First phone number with international country code : ['EGP'=2,'USA'=1,'SA'=966 ] True
first_callee_name First recipient name True
second_callee_number Second phone number with international country code : ['EGP'=2,'USA'=1,'SA'=966 ] True
second_callee_name Second recipient name True
call_time Call time if delay is needed False
duration Total bridged call time True

Call Status

curl --location --request POST 'https://api.bridge.innocalls.com/api/v1/call/bridge' \
--header "Authorization: Bearer ${TOKEN}" \
--form 'call_id=f2281763-e58a-4817-bc34-4b120c230cfbas' \
--form 'call_flow_id=XXXXXXXXXXXXXXXXX' \

            

The above command returns JSON structured like this:


{
  "status": 200,
  "success": true,
  "data": {
    "callStatus": {
      "scheduledDateTime": "2020-04-23 10:31:47",
      "actualDateTime": "2020-04-23 10:31:47",
      "callDuration": "5 Minutes",
      "callerId": "XXXXXXX",
      "firstRecipientName": "ahmed",
      "firstRecipientNumber": "2010XXXXX",
      "firstRecipientStatus": "answered",
      "secondRecipientName": "kand",
      "secondRecipientNumber": "13456",
      "secondRecipientStatus": "not_answered",
      "callStatus": "failed",
      "callId": "f2281763-e58a-4817-bc34-4b120c230cfbas"
    }
  }
}

            

You can get call status by call id

HTTP Request

GET https://api.bridge.innocalls.com/api/v1/call/status

URL Parameters

Parameter Value Required
call_id call id returned after initiating the call True
call_flow_id the flow used in this call True

Call Merging

Call Dispatch

curl --location --request POST 'https://api.innocalls.net/api/v1/call' \
--header "Authorization: Bearer ${TOKEN}" \
--form 'phone=966XXXXX' \
--form 'number_1=1' \
--form 'number_2=2' \
--form 'webhook=#'

  

The above command returns JSON structured like this:


{
    "status": 200,
    "success": true,
    "data": {
        "message": "Call Sent",
        "callId": "sJLJhtAqEUbhcvP"
    }
}
            

HTTP Request

POST https://api.innocalls.net/api/v1/call

Parameters

Parameter Value Required
phone Phone number With international country code : ['EGP'=2,'USA'=1,'SA'=966 ] True
number_1 The number to be placed as the first dynamic value True
number_2 The number to be placed as the second dynamic value True
webhook A url to receive call information True

Click Action

GET HTTP Request is sent to the webhook with the number clicked

Parameters

Parameter Description - Options
action GetDigits
callId the call id returned in the dispatch call request
clicked the clicked number by the callee

CDR

GET HTTP Request is sent to the webhook with call status

Parameters

Parameter Description - Options
action CDR
callId the call id returned in the dispatch call request
disposition the call status : ( Answered - Failed )
to the destination we sent the call to

WebRTC

Integration

    curl --location --request GET 'https://webrtc.innocalls.com/integration.php?phone_number=00966xxxxxxx' 
  

You can initiate calls from your CRM by integrating with our WebRTC

HTTP Request

GET https://webrtc.innocalls.com/integration.php

Query Parameters

Parameter Value Required
phone_number Phone number with international country code : ['SA'=966 ,00966 ] True
if your Extension is not logged in , you will be redirected to the login page

Errors

The API uses the following error codes:

Error Code Meaning
400 Bad Request -- Your request sucks
401 Unauthorized -- Your API key is wrong
403 Forbidden -- The kitten requested is hidden for administrators only
404 Not Found -- The specified kitten could not be found
405 Method Not Allowed -- You tried to access a kitten with an invalid method
406 Not Acceptable -- You requested a format that isn't json
410 Gone -- The kitten requested has been removed from our servers
418 I'm a teapot
429 Too Many Requests -- You're requesting too many kittens! Slow down!
500 Internal Server Error -- We had a problem with our server. Try again later.
503 Service Unavailable -- We're temporarially offline for maintanance. Please try again later.