9BITS DEVELOPER CENTRE
  • 9bits Developer Center
  • MESSAGING
    • A2P SMS
      • Overview
      • Start sending A2P SMS
      • Getting Started
      • REST API
        • Overview
        • Batches
        • Delivery Reports
          • Retrieve a delivery report
        • Webhooks
      • SMPP
        • Connectivity
        • Sending Messages
        • Message Encoding
        • SMPP Error Codes
    • Two-Way SMS
      • Overview
      • Start receiving Two-Way SMS
      • Start sending Two-Way SMS
      • Getting Started
      • REST API
        • Overview
        • Webhooks
  • VOICE
    • Voice Messaging API
      • Overview
      • The Call Object
      • Send a voice message
    • SIP Trunking
      • Overview
      • Technical Details
Powered by GitBook
On this page
  • Arguments
  • Callbacks
  1. VOICE
  2. Voice Messaging API

Send a voice message

Make an outbound call and then play your media

This method lets you deliver a voice message to a PSTN number, and deliver voice message to multiple PSTN numbers.

Arguments

to The destination to be called. The destination should be a regular number. A regular number should be specified with the country code followed by the number.

Example 2348020000000

You can deliver voice message to multiple numbers at once by adding all the numbers in a square bracket. For example, if you want to deliver to two numbers, specify them in the to field:

["2348020000000", "2348030000000"]

Note: The maximum number of unique destinations accepted in the "to" field is 1000.

media_url The location of the media/audio file. This specifies where the media file is located.

Example https://www.learningcontainer.com/wp-content/uploads/2020/02/Kalimba.mp3

The media file will be fetched and then converted to the most suitable format for the best audio quality over the GSM network.

Example POST request

{
    "to": ["2348020000000", "2348030000000"],
    "media_url": "https://www.learningcontainer.com/wp-content/uploads/2020/02/Kalimba.mp3"
}

Specifying from is not necessary as your registered caller id will be fetched and used. If there are multiple caller ids, then only one will be randomly selected.

Callbacks

For every attempt to deliver a voice message, 9bits sends a status update to your URL configured as a callback.

PreviousThe Call ObjectNextSIP Trunking

Last updated 3 months ago