Add a date

Add a date for a course (start date, end date, place etc.) using POST.

Request

POST https://api.frontcore.com/v2/courses/:id/coursedates

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
start_at required string yyyy-mm-dd
end_at required string yyyy-mm-dd
deadline_at optional string yyyy-mm-dd
start_time_at optional string hh:mm
end_time_at optional string hh:mm
timezone optional string Timezone in IANA format (e.g., "Europe/Oslo").
visible_when_passed_deadline optional bool Default is 1 (not set)
teaching_language optional string Default is no ("no" as in Norwegian)
place_id optional integer Use integer found in this list. Or use place_by_search.
status_id optional integer Use integer found in this list
  • 1 = To be defined
  • 2 = Will run
  • 3 = Canceled
  • 4 = Postponed
place_by_search optional string If place_id is not set. Search for place and use result if found.
place_additional_info optional string Additional info about the location.
reference optional string Your own reference, if needed.
instructors optional array List of instructor IDs associated with the event.
gatherings
(Known as meetups in FrontCore UI)
optional string
Name Required Value Description
gathering_at required string|date Format "yyyy-mm-dd hh:mm" or just "yyyy-mm-dd". If only date is used, time_start and time_end must be provided.
gathering_end_at required string|date Format "yyyy-mm-dd hh:mm" or just "yyyy-mm-dd". If only date is used, time_start and time_end must be provided.
time_start optional time Required if gathering_at/gathering_end_at are given as yyyy-mm-dd only. Format "hh:mm".
time_end optional time Required if gathering_at/gathering_end_at are given as yyyy-mm-dd only. Format "hh:mm".
idLocation optional integer|null Reference to location ID, or null.
description optional string|null Optional description of the event.
theme optional string|null Optional theme of the event.
event_url optional string|null Optional URL for the event.
updated_at optional datetime Auto-generated timestamp when event is updated.
instructors optional array List of instructor IDs associated with the event.

Example code in PHP

$post_params = array();
$post_params['start_at'] = '2020-04-02';
$post_params['end_at'] = '2020-04-10';
$post_params['deadline_at'] = '2020-03-29';
$post_params['visible_when_passed_deadline'] = '1';
$post_params['teaching_language'] = 'no';
$post_params['place_id'] = '637';
$post_params['place_by_search'] = 'Oslo'; // An example. place_id takes precedence.
$post_params['place_additional_info'] = 'Vika';
$post_params['reference'] = 'COURSE1300';

$request_url = 'https://api.frontcore.com/v2/courses/22353/coursedates';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $request_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $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.

{
    "coursedate_id": 12952706,
    "course_id": 22353
}

Unsuccessful response sample:

{
    "error": "Field(s) not valid: start_at"
}      
© 2025 FrontCore