<!-- Intent: parses the text content and returns a VOICE_ALERT_CONTENT object --> <?php $url = 'http://api.v4.swiftreach.com/api/Messages/Voice/Helpers/TextToVoiceContentObject/alert_human/true'; $authToken = '123456'; $jsonString = "This is my message."; $headers = array( 'Content-type: application/json', 'SwiftAPI-Key: ' . $authToken, 'Accept: application/json', 'Expect:' ); $ch = curl_init(); $args = array( CURLOPT_URL => $url, CURLOPT_FOLLOWLOCATION => TRUE, CURLOPT_RETURNTRANSFER => TRUE, CURLOPT_POST => TRUE, CURLOPT_POSTFIELDS => $jsonString, CURLOPT_HTTPHEADER => $headers, ); curl_setopt_array($ch, $args); $res = curl_exec($ch); $res_data = json_decode($res, true); print($res_data); ?> <!-- example return value --> { "VoiceItemType":1, "AudioSource":[{ "$type":"SwiftReach.Swift911.Core.Messages.Voice.AUDIO_SOURCE_VOICE, SwiftReach.Swift911.Core", "VoiceCode":0, "Content":"This is the message.", "AutoGenerateVoice":true, "FileVersion":0, "AudioType":0 }] }