Sample PHP Code

// Setup the payload here. The structure of the payload itself will obviously
// change depending on which method/dataset combination we call and what
// parameters that method/dataset combination requires.
// Note the inclusion of "apirequest=" at the start of the Payload string.
// This ensures that the POST data will be received by the API as a
// proper POST name/value pair.

// It would be potentially possible to retrieve data from the API using a native PHP
// method such as file_get_contents, but traditionally, the cURL extension is the
// preferred way to send POST data to an endpoint service.

$XMLPayload = @"apirequest=<?xml version=\"1.0\" encoding=\"UTF-8\" ?><data>

// The API Endpoint
$endpoint = "";

// Initialize the cURL object
$ch = curl_init($endpoint);

// Set some default options
curl_setopt($ch, CURLOPT_POST, TRUE); // Tells cURL we're doing a POST request
curl_setopt($ch, CURLOPT_POSTFIELDS, $XMLPayload); // Add the payload to the request
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); // Tell cURL we want to capture the response from the server

// Make the service call and assign the server's return to the $response variable
$response = curl_exec($ch);

// You can process the returned response here. For the purposes of this sample, we'll just
// dump the raw text to the screen