How to send an SMS using the API

Here is an example sh script that will send an SMS using your babelforce account API credentials:

ACCESS_ID='yourlongbabelforceapiaccessidgoeshere'
TOKEN='yourlongbabelforceapitokengoeshere'

ENDPOINT="https://services.babelforce.com/api/1/sms"

curl $ENDPOINT \
-H "X-Auth-Access-Token: $TOKEN" \
-H "X-Auth-Access-Id: $ACCESS_ID" \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
--data-binary '{"toNumber":"+4415112893779","displayName":"+491221312333","message":"your message here"}'

 

It's that simple.

 

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

{

  "data" : {

    "sms" : {

      "id" : 32205,

      "dateCreated" : "2014-11-13T15:50:08.389Z",

      "type" : "outbound",

      "displayName" : "491221312333",

      "to" : "4415112893779",

      "state" : "queued",

      "message" : "your message here"

    },

    "message" : "sms sent to 4415112893779",

    "success" : true

  }

 

 

Have more questions? Submit a request