Voice Messaging

Samples

Samples

The following samples assume that the request headers mentioned in the 3 section, are present.

 

Simple Text-To-Speech Job Request


{
    "destinations":[
       
        {
            "number":"35688000000"
        }
          
   ],
    "voice_content": {
        "sender_id":"356123456",
        "tts_lang":"en-GB",
        "tts_voice":"man",
        "tts_text":"Testing a voice call"
    }
}

What it does:

  • Call to 1 recipient (“number”:”35688000000″).
  • Text-to-Speech call with a British male voice stating “Testing a voice call”
  • Other missing parameters are automatically gathered from the Token.

 

Complex Text-To-Speech Job Request


{
	"destinations": [{
		"custom_id": "test-destination-1",
		"number": "35688000000"
	},{
		"custom_id": "test-destination-2",
		"number": "35688000001"
	}
  ],
	"voice_content": {
		"tts_text": "This is a test message.",
		"time_limit_seconds": "600",
		"tts_lang": "en-GB",
		"sender_id": "356123456",
		"tts_voice": "man"
	},
	"job_id": "my-custom-job-id-1000",
	"callback_url": "http://example.com/callback”
}

What it does:

  • Has 2 destinations with a custom_id for each destination.
  • Create a Text-To-Speech call with specific content.
  • Sets a custom sender_id.
  • Specify the text language.
  • Sets callback_url to where call backs are to be sent.
  • Sets a custom unique identifier for the job

 

Simple Audio Job Request


{
 "destinations": [{    
      "number": "35688000000"
  }],
 "voice_content": {      
      "audio_file_url": "http://example.com/voiceclip1.mp3"
 }}

What it does:

  • Has 1 destination.
  • Call will play audio file.

 

Complex Audio Job Request


{
	"destinations": [{
		"custom_id": "test-destination-1",
		"number": "35688000000"
	},{
		"custom_id": "test-destination-2",
		"number": "35688000001"
	}
  ],
	"voice_content": {
		"audio_file_url": "http://example.com/voiceclip1.mp3",
		"ring_timeout_seconds": "60",
		"hangup_ring_seconds": "120",
		"time_limit_seconds": "200",
		"sender_id": "356123456",
		"enable_menu_response":true
	},
	"job_id": "my-custom-job-id-1000",
	"callback_url": "http://example.com/callback"
}

What it does:

  • Has 2 destinations with a custom_id for each destination.
  • Creates an Audio call with a specific MP3 audio file.
  • Sets a custom sender_id.
  • Sets callback_url to where callbacks are to be sent.
  • Sets a custom unique identifier for the job
  • Enable the end-client on the call to press any key from his phone and send this back as a callback.
  • There are 3 types of timeouts (further explained in the Request Body section)
Get Started