<!-- Intent: gets the list of contacts in the contact list with ListCode 123456 sorted by Phone. This will return the first 5 rows. --> <?php $curl_h = curl_init('http://api.v4.swiftreach.com/api/ContactLists/Contacts/List/123456/1/5/Phone/DESC'); curl_setopt($curl_h, CURLOPT_HTTPHEADER, array('Accept: application/json', 'Content-Type: application/json', 'SwiftAPI-Key: 123456') ); # do not output, but store to variable curl_setopt($curl_h, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($curl_h); # output for testing echo $response; ?>