How to make an outbound call using the API

Here is an example sh script that makes a call using babelforce API account credentials - it connects a particular agent in Zendesk (FROM number) with the callee (TO number):

TO='+447905123456'

ACCESS_ID='yourlongbabelforceapiaccessidgoeshere'
TOKEN='yourlongbabelforceapitokengoeshere' 

FROM='+493044123456'
DISPLAY='+417878787889'

echo "making call from $FROM to $TO as $DISPLAY"

curl 'https://services.babelforce.com/api/1/call' \
-H "X-Auth-Access-Token: $TOKEN" \
-H "X-Auth-Access-Id: $ACCESS_ID" \
-H 'Content-Type: application/json' \
--data-binary "{\"call\":{\"toNumber\":\"$TO\",\"fromNumber\":\"$FROM\",\"displayNumber\":\"$DISPLAY\"}}"

 

Running the above on the command line will give you this:

 

making call from +493044123456 to +447905123456 as +417878787889

{

  "data" : {

    "message" : "started call for John Smith to 447905123456 as 417878787889",

    "call" : {

      "callerNumber" : "493044123456",

      "calleeNumber" : "447905123456",

      "displayNumber" : "417878787889"

    },

    "agent" : {

      "id" : 9,

      "sourceId" : "421234126",

      "type" : "ZENDESK"

    },

    "success" : true

  }

Have more questions? Submit a request