Message controller{accountSID}/messages


Message controller allows you to be informed on the current message status and also send XML instructions in response.

You will need to create an Application and specify controller URL for it. Then use this application’s SID when making the Send message request. Thus Apifonica will be able to notify you every time a message status changes.

The event body will be delivered as URL parameters for a GET HTTP method and www-form-urlencoded for a POST method

Request example

curl –X POST{accountSID}/messages \
-H ‘Content-Type: application/json’ \
-d ‘{
        "from": "35315313424",
        "to": "447860041755",
        "msg_app_sid": "app0794c1fe-b34b-3d89-bc91-faf37a343f83",
        "text": "Apifonica API provides a really cool SMS messaging service"
    }' \
-u {accountSID}:{authToken}

Response example

  "status_code": 201,
  "status_message": "CREATED",
  "uri": "/v2/accounts/{accountSID}/messages/{messageSID}"

Apifonica request parameters being sent to controller url

The following parameters are sent to controller URL specified in msg_app_sid.
  account_sid: '{accountSID}',
  direction: 'outbound',
  from: '35315313424',
  message_sid: '{messageSID}',
  sms_count: '1',
  status: 'sent',
  text: 'Apifonica API provides a really cool SMS messaging service',
  to: '447860041755'

Possible message statuses

Status value


Example of the message statuses in the controller

By visiting the Apifonica website you agree with our use of cookies. Read our Cookie Policy here.