Messages

Messages link audio files in different languages, as well as SMS text, to build one piece of content that can be attached to an outgoing call. You can reuse messages in future outgoing calls, and monitor overall engagement statistics for a message (e.g.: total airtime listened to, average fraction listened, etc.)

Create A Message

Method: POST

URL: https://go.votomobile.org/api/v1/messages

Parameters:

  • api_key
  • audio_file : should be posted with a language_id associated with it.
Eg.

 audio_file[language_id] = audio_file_id

 audio_file[5] = 32,

 audio_file[8] = 33,

 audio_file[13] = 35
  • sms_content : You can add sms for each language to messages in the following format. Each sms_content should be posted with a language_id associated with it.
Eg.

 sms_content[language_id] = sms_message

 sms_content[590] = "There will be water shortage today in the district."

 sms_content[854] = "VOTO Mobile tente a ameliores la communication aux citoyennex.",

 sms_content[1374] = "Visit the institute for free maternal healthcare and remember to feed your baby regularly."
  • has_voice : Indicate whether the message contains a voice message. Value should be 1 for true and 0 for false.
  • has_sms : Indicate whether the message contains an sms message. Value should be 1 for true and 0 for false.
  • title : the title of the message { eg. Maintenance Message }
  • hidden : Indicate whether the message should be set to archived on the VOTO platform (Only applies to create message), useful when creating automated messages. Value shoud be 1 for true and 0 for false.

Returns:

ID of the message

{"status":200,"message":"Message Created Successfully","data":{id: 112}}

Update A Message

Method: PUT

URL: https://go.votomobile.org/api/v1/messages/[message_id]

Parameters:

  • api_key
  • has_voice (optional) : Indicate whether the message contains a voice message. Value should be 1 for true and 0 for false.
  • has_sms (optional) : Indicate whether the message contains an sms message. Value should be 1 for true and 0 for false.
  • title (optional) : the title of the message { eg. Maintenance Message }
  • audio_file : should be posted with a language_id associated with it. If audio_file_id can be left blank for no audio file posted.
audio_file[language_id] = audio_file_id

audio_file[5] = 32,

audio_file[8] = ,

audio_file[13] = 35
  • sms_content : You can add sms for each language to messages in the following format. Each sms_content should be posted with a language_id associated with it. SMS content for a language can be left blank for no content.
sms_content[language_id] = sms_message

sms_content[590] = "There will be water shortage today in the district."

sms_content[854] = "VOTO Mobile seeks to enhance citizen communication.",

sms_content[1374] = "Visit the institute for free maternal healthcare and remember to feed your baby regularly."

Returns:

ID of the message

{"status":200,"message":"Message Created Successfully","data":{id: 112}}

List Messages

Method: GET

URL: https://go.votomobile.org/api/v1/messages

Parameters:

  • api_key

Returns:

{
"status":200,
"message":"Messages",
  "data": {
    "messages": [
       {
        id: 56,
        title: "Message A",
        has_voice : 1,
        has_sms : 0,
        created_at : "2013-09-24 01:57:25",
        updated_at : "2013-09-24 09:58:25"
       },
       {
        id: 78,
        title: "Message B",
        has_voice : 1,
        has_sms : 1,
        created_at : "2013-09-24 12:57:25",
        updated_at : "2013-09-24 14:58:25"
       }
    ]
  }
}

List Details Of A Message

Method: GET

URL: https://go.votomobile.org/api/v1/messages/[message_id]

Parameters:

  • api_key

Returns:

{
  "status": 200,
  "code": 1000,
  "data": {
      "message": {
          "id": "77",
          "title": "Typhoon Alert Message",
          "has_sms": "1",
          "has_voice": "1",
          "created_at": "2014-01-21 16:53:05",
          "updated_at": "2014-02-03 12:10:42"
      },
      "sms_content": [
          {
              "language_id": "39",
              "id": "39",
              "name": "Dagbani",
              "abbreviation": "DA",
              "sms_content": "Dagbani's sms content here!"
          },
          {
              "language_id": "40",
              "id": "40",
              "name": "English",
              "abbreviation": "EN",
              "sms_content": null
          },
          {
              "language_id": "41",
              "id": "41",
              "name": "New Lang",
              "abbreviation": "NL",
              "sms_content": "There will be a typhoon in the next 48 hours!"
          },
          {
              "language_id": "52",
              "id": "52",
              "name": "API Lang",
              "abbreviation": "AP",
              "sms_content": null
          }
      ],
      "audio_files": [
          {
              "language_id": "39",
              "id": "39",
              "name": "Dagbani",
              "abbreviation": "DA",
              "audio_file_id": "129",
              "audio_file_description": null
          },
          {
              "language_id": "40",
              "id": "40",
              "name": "English",
              "abbreviation": "EN",
              "audio_file_id": null,
              "audio_file_description": null
          },
          {
              "language_id": "41",
              "id": "41",
              "name": "New Lang",
              "abbreviation": "NL",
              "audio_file_id": null,
              "audio_file_description": null
          },
          {
              "language_id": "52",
              "id": "52",
              "name": "API Lang",
              "abbreviation": "AP",
              "audio_file_id": null,
              "audio_file_description": null
          }
      ]
  },
  "message": "Message Details Fetched Successfully",
  "more_info": ""
}

Delete A Message

Method: DELETE

URL: https://go.votomobile.org/api/v1/messages/[message_id]

Parameters: Specify message_id to delete

  • api_key

Returns:

{"status":200,"message":"Succesfully deleted message"}

Count Interactions (Delivery Logs) for a Message

Count the number of delivery logs (individual subscriber interactions) associated with a Message. You can optionally filter by delivery status and by date/time range.

Method: GET

URL: https://go.votomobile.org/api/v1/messages/[message_id]/counts

Parameters:

  • api_key
  • filter_delivery_status (optional): Include only interactions with this delivery_status (e.g.: ‘6’ for Finished (Completed); ‘5’ for Failed (No Answer), etc.)
  • filter_after_date (optional): Include only interactions that ended after this date/time. Allowed format: ‘2015-09-23’ or ‘2015-09-23 14:02:37’, in UTC.
  • filter_before_date (optional): Include only interactions that ended before this date/time. Allowed format: ‘2015-09-23’ or ‘2015-09-23 14:02:37’, in UTC.

Returns:

{
  "status": 200,
  "code": 1000,
  "data": {
      "message_id": "201385",
      "filter_delivery_status": "6",
      "filter_after_date": "2014-02-15",
      "count": 16
  },
  "message": "Fetched Message Counts: times accessed.",
  "more_info": "",
  "pagination": null,
  "url": "https://go.votomobile.org/api/v1/messages/201385/counts?filter_delivery_status=6&filter_after_date=2014-02-15"
}