//-- Intent: send the voice message with voicecode of 100000 to  --//
//-- an array of contacts posted in the body of the request --//
//-- and name the alert "My Test Alert" --//


var jsonString = ' \
[{ \
"EntityName":"Sample Test", \
"EntityGuid":"952a9bb6-ceac-4f15-9678-ec4e52f564a1", \
"Phones":[{ \
                 "Phone":"9085551212", \
                 "Extension":"", \
                 "AnsDetectionOverride":0, \
                 "OptInSMS":true, \ 
                 "PhoneType":0, \
                 "PhoneLabel":"Mobile" \
                },{ \
                 "Phone":"7025551212", \
                "Extension":"", \
                "AnsDetectionOverride":0, \
                "OptInSMS":true, \
                "PhoneType":0, \
                "PhoneLabel":"Phone" \
               }] \
}]';

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

});