<!-- Intent: takes the given array of VOICE_ALERT_PROFILE objects
	and returns the text content for the specified language.
	-->


<?php
$url = 'http://api.v4.swiftreach.com/api/Messages/Voice/Helpers/VoiceContentProfileArrayToText/Spanish/alert_human';
$authToken = '123456';


$jsonString = ' 
[{ 
	"SpokenLanguage":"English", 
	"TTY_Text":"This is a test of the conferencing platform. You are being bridged onto a conference call now.", 
	"VoiceItem":[{ 
		"VoiceItemType":1, 
		"AudioSource":[{ 
			"$type":"SwiftReach.Swift911.Core.Messages.Voice.AUDIO_SOURCE_VOICE, SwiftReach.Swift911.Core", 
			"VoiceCode":100237, 
			"Content":"This is a test of the conferencing platform. You are being bridged onto a conference call now.", 
			"AutoGenerateVoice":true, 
			"FileVersion":0, 
			"AudioType":0 
			}] 
		}] 
},{ 
	"SpokenLanguage":"Spanish", 
	"TTY_Text":"This is a test of the conferencing platform. You are being bridged onto a conference call now.", 
	"VoiceItem":[{ 
		"VoiceItemType":1, 
		"AudioSource":[{ 
			"$type":"SwiftReach.Swift911.Core.Messages.Voice.AUDIO_SOURCE_VOICE, SwiftReach.Swift911.Core", 
			"VoiceCode":100967, 
			"Content":"Se trata de una prueba de la plataforma de la Conferencia. Usted esta siendo puente en una conferencia telefonica ahora.", 
			"AutoGenerateVoice":false, 
			"FileVersion":0, 
			"AudioType":0 
			}] 
		}] 
}]';

$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 -->
"Se trata de una prueba de la plataforma de la Conferencia. Usted esta siendo puente en una conferencia telefonica ahora."