//-- Intent: Create a new Voice_Message  --//

var jsonString = ' \
{ \
	"$type":"SwiftReach.Swift911.Core.Messages.Voice.Voice_Message, SwiftReach.Swift911.Core", \
	"Name":"The Voice Message", \
	"Description":"this is a test",	\
	"DefaultSpokenLanguage":"English", \
        "AutoReplays":1, \
        "RequireResponse":false, \
        "ValidResponses":null, \
	"EnableAnsweringMachineDetection":false, \
	"EnableAnsweringMachineMessage":false, \
	"CallerID":"2012361344", \
	"CapacityLimit":0, \
	"RingSeconds":60, \
	"CongestionAttempts":3, \
	"AutoRetries":0, \
	"AutoRetriesInterval":3, \
	"EnableWaterfall":false, \
	"VoiceType":"voice_message", \
	"ContentProfile":[{ \
			"SpokenLanguage":"English", \
			"TTY_Text":"This is what I want to show up on a TTY", \
			"VoiceItem":[{ \
					"VoiceItemType":"alert_human", \
					"AudioSource":[{ \
							"$type":"SwiftReach.Swift911.Core.Messages.Voice.AUDIO_SOURCE_TTS_TEXT, SwiftReach.Swift911.Core", \
				                        "AudioType":"audio_source_tts_text", \
				                        "TTSText":"This is the message." \
							}]\
					}]\
			}]\
}';

$.ajax({
  type: "POST",
  contentType: "application/json; charset=utf-8",
  headers: {"SwiftAPI-Key": "12345"},
  url: "http://api.v4.swiftreach.com/api/Messages/Voice/Create",
  data: jsonString,
  dataType: "json"
  success: function(result) {
        // Do something with the result
    }

});

<!-- example return value -->
123456