//-- Intent: sends a voice message with voicecode 100123 and --//
//-- sends an email message with emailcode 100278 to --//
//-- an array of contacts and names the alert "My Test Alert" --//


var jsonString = ' \
[{ \
	"EntityName":"Sample Test", \
	"EntityGuid":"952a9bb6-ceac-4f15-9678-ec4e52f564a1", \
	"Phones": \
		[{ \
		"Phone":"5551234567", \
		"Extension":"", \
		"AnsDetectionOverride":0, \
		"OptInSMS":true, \
		"PhoneType":0, \
		"PhoneLabel":"Mobile" \
		},{ \
		"Phone":"5551234568", \
		"Extension":"", \
		"AnsDetectionOverride":0, \
		"OptInSMS":false, \
		"PhoneType":0, \
		"PhoneLabel":"Phone" \
		}], \
	"Addresses": \
		[{ \
		"AddressGuid":"9a360c7a-dd65-4fcf-96fe-ff20a63610b0", \
		"Label":"Primary Address", \
		"Address1":"", \
		"Address2":"", \
		"City":"", \
		"State":"", \
		"PostalCode":"", \
		"County":"", \
		"Latitude":0.0, \
		"Longitude":0.0, \
		"IsPrimary":true \
		}], \ 
		"Email":"testing@swiftreach.com", \
		"Fax":"5555551212", \
		"SMSPhone":"", \
		"SMSNetwork":0, \
		"Pager":"", \
		"PagerNetwork":0, \
		"PinCode":"", \
		"SpokenLanguage":"English", \
		"Tag":"", \
		"UserDefined":[] \
}]';

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

});

<!-- example return value -->
123456