17-19 February 2022

TEST Confirmed entries

$apiKey,

‘eventId’ => $eventId,

‘searchString’ => $searchString,

‘limit’ => $limit,

‘offset’ => $offset,

‘sortOrder’ => $sortOrder

];

// Build a JSON encoded string to send to the server.

$dataString = json_encode($dataArr);

// Initialize cURL

$ch = curl_init();

// Set the cURL URL given the controller in c=ControllerName and fn=ControllerFunction

// e.g. exec.php?c=Event&fn=getEntriesList

curl_setopt($ch, CURLOPT_URL, $apiUrl);

// Use cURL POST method

curl_setopt($ch, CURLOPT_POST, 1);

// Set the data to post using $dataString

curl_setopt($ch, CURLOPT_POSTFIELDS, $dataString);

// TRUE to return the transfer as a string of the return value of

// curl_exec() instead of outputting it out directly.

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

// Disable cURL SSL certificate checking. This should NOT be done on poduction system.

curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

// Set content type header to application/json

curl_setopt($ch, CURLOPT_HTTPHEADER, array(

‘Content-Type: application/json’,

‘Content-Length: ‘ . strlen($dataString))

);

// receive server response

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

// Save the response output in a variable

$serverOutput = curl_exec($ch);

// Check for cURL error

if( curl_errno($ch) !== 0 ) {

die(‘cURL returned error code ‘ . curl_errno($ch) . ‘ – ‘ . curl_error($ch));

}

// Function returns a JSON result in the following format:

//

// {

// “ok”: true,

// “entries”: [

// {

// “k1”: {

// “name”: “JOHN DOE”,

// “csaId”: 12345

// },

// “k2”: {

// “name”: “BEN DOE”,

// “csaId”: 12346

// },

// “k3”: null,

// “k4”: null,

// “entryDate”: “2020-11-04”,

// “entryTime”: “20:11:14”,

// “raceName”: “BEST EVENT EVER”,

// “orderNumber”: “ORD00001234”

// },

// .

// .

// .

// ]

// }

//

// ok: This value will be true if the function executed successfuly and false if an error occured.

// error: A description of the error that occurred. This property is omitted if ‘ok’ is true.

// entries: An array of ‘entry’ objects

// entry.k1 An object with the details of the K1 entrant. Will be null if there is no K1 entrant.

// entry.k1.name The name of the the K1 entrant.

// entry.k1.csaId The CSA ID of the K1 entrant.

// entry.k2 An object with the details of the K2 entrant. Will be null if there is no K2 entrant.

// entry.k2.name The name of the the K2 entrant.

// entry.k2.csaId The CSA ID of the K2 entrant.

// entry.k3 An object with the details of the K3 entrant. Will be null if there is no K3 entrant.

// entry.k3.name The name of the the K3 entrant.

// entry.k3.csaId The CSA ID of the K3 entrant.

// entry.k4 An object with the details of the K4 entrant. Will be null if there is no K4 entrant.

// entry.k4.name The name of the the K4 entrant.

// entry.k4.csaId The CSA ID of the K4 entrant.

// entry.entryDate The date the entry was made.

// entry.entryTime The time the entry was made.

// entry.raceName The name of the race that was entered. (The race is a sub category of an event).

// entry.orderNumber The order number of the entry.

$json = json_decode($serverOutput, true);

print_r($json);

// Close the cURL channel

curl_close($ch);

?>