Get locations

Download schools locations using GET.

Request

GET https://www.kursguiden.no/api/v2/locations

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
limit optional number Amount of results (default: 75) (maximum: 250)
page optional number Page to show (default: 1)
since_id optional number Restrict results to after the specified ID.
created_at_min optional string Show items created after date (format: yyyy-mm-dd OR yyyy-mm-dd hh:mm:ss)
created_at_max optional string Show items created before date (format: yyyy-mm-dd OR yyyy-mm-dd hh:mm:ss)
updated_at_min optional string Show items last updated after date (format: yyyy-mm-dd OR yyyy-mm-dd hh:mm:ss)
updated_at_max optional string Show items last updated before date (format: yyyy-mm-dd OR yyyy-mm-dd hh:mm:ss)

Example code in PHP

$request_url = 'https://www.kursguiden.no/api/v2/locations';
$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);
               

Response

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

[
    {
        "address": null,
        "address2": null,
        "address3": null,
        "cancellation_days": 0,
        "capacity_budget": 0,
        "capacity_max": 0,
        "capacity_min": 0,
        "capacity_overbook": 0,
        "capacity_wait": 0,
        "city": null,
        "country": "Norway",
        "country_code": "NO",
        "county": "Sem",
        "custom_title": null,
        "email_booking": null,
        "email_moreinfo": null,
        "full_address": null,
        "id": 6489,
        "idCountry": "159",
        "idInstructor": null,
        "idPlace": 1226,
        "instructor": null,
        "is_archived": false,
        "is_default": false,
        "is_notification_enabled": false,
        "is_virtual": false,
        "lat": 59.2823015,
        "lng": 10.3300322,
        "long_text": null,
        "notification_days": 0,
        "notification_role": null,
        "place": {
            "id": "1226",
            "idParent": "3",
            "title": "Sem",
            "parent": {
                "id": "3",
                "idParent": "0",
                "title": "Vestfold"
            },
            "idCountry": "159",
            "country": "Norway"
        },
        "short_text": null,
        "short_text_2": null,
        "state": "Vestfold",
        "timezone": null,
        "title": "Sem",
        "zipcode": null
    }
]

Unsuccessful response sample:

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