Delete a date for a course using DELETE.
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.
$request_url = 'https://www.kursguiden.no/api/v1/courses/22353/coursedates/9304810'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $request_url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE"); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'X-API-Key: {your-api-key}', 'Accept: application/json', )); $result = curl_exec($ch); curl_close($ch);
If the method is successful it responds with an JSON structure, as it is shown below.
{ "status": "success", "coursedate_id": "9304810", "course_id": "22353" }
Unsuccessful response sample:
{ "status": "failure", "message": "Wrong API Key" }