<!-- Intent: return the text content of the pager_content object --> <?php $url = 'http://api.v4.swiftreach.com/api/Messages/Pager/Helpers/PagerContentObjectToText'; $authToken = '123456'; $jsonString = ' { "SpokenLanguage":"English", "Subject":"my subject", "Body": [{ "$type":"SwiftReach.Swift911.Core.Messages.Pager.PAGER_TEXT_SOURCE_TEXT, SwiftReach.Swift911.Core", "Text":"this is the body of my message", "TextType":"pager_text_source_text" }] }'; $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 --> 'this is the body of my message'