Get a list of supported course roles
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://api.frontcore.com/v2/course-roles';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $request_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
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.
[
{
"id": "1",
"type": "hostess",
"title": "Vertinne",
"order": "2"
},
{
"id": "2",
"type": "project_manager",
"title": "Prosjektleder",
"order": "1"
},
{
"id": "3",
"type": "marketer",
"title": "Markedsf\u00f8rer",
"order": "0"
},
{
"id": "4",
"type": "customer_service",
"title": "Kundeservice",
"order": "4"
},
{
"id": "5",
"type": "hotel_contact",
"title": "Hotellkontakt",
"order": "5"
},
{
"id": "6",
"type": "course_host",
"title": "Kursvert",
"order": "3"
},
{
"id": "7",
"type": "trainer",
"title": "Kursholder",
"order": "6"
},
{
"id": "8",
"type": "it_manager",
"title": "IT-sjef",
"order": "7"
}
]
Unsuccessful response sample:
{
"error": "Wrong API Key"
}