Update participant

Updates a participant using PUT

Request

PUT https://www.kursguiden.no/api/v2/participants/:id

For every API request you make, you'll need to present the API access key in the HTTP Header as X-API-Key to be authenticated.

Parameters

Name Required Value Description
idStatus optional number Enrollment status
  • 1 = Confirmed
  • 2 = Overbooked
  • 3 = Waitinglist
  • 4 = Deregistered (Unenrolled)
  • 7 = Unconfirmed
  • 8 = Deregistered with fee
completed optional boolean Completed status
  • true = Completed
  • false = Not completed
passed optional boolean Passed status
  • true = Passed
  • false = Not passed

Example code in PHP

$post_params = array();
$post_params['idStatus'] = '1';
$request_url = 'https://www.kursguiden.no/api/v2/participants/:id';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $request_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post_params));

curl_setopt($ch, CURLOPT_HTTPHEADER, array(
  'X-API-Key: {your-api-key}',
  'Accept: application/json',
));
$result = curl_exec($ch);
curl_close($ch);
               

Response

If the method is successful it responds with an JSON structure, as it is shown below.



                

Unsuccessful response sample:

{
    "error": "Wrong API Key"
}      
© 2024 FrontCore