Skip to content
DmrGTUE edited this page Aug 1, 2021 · 9 revisions

This document is user documentation for accessing the website API.

Administration

To obtain API access, first ask the web committee for an API token.

Logging in

You don't need to authenticate separately when using an API token. You only need to include a X-Auth-Token header in every request with the token as it's value.

Every API endpoint returns JSON.

API endpoints

Activities

/api/activity/list

Returns a list with activities.

Example:

[{
    "id": 3,
    "name": "AC Geld Verbranden",
    "nameEn": "AC Burning Money",
    "beginTime": {
        "date": "2015-05-05 05:05:05.000000",
        "timezone_type": 3,
        "timezone": "Europe\/Berlin"
    },
    "endTime": {
        "date": "2015-05-06 05:05:05.000000",
        "timezone_type": 3,
        "timezone": "Europe\/Berlin"
    },
    "location": "GEWIS",
    "LocationEn": "GEWIS",
    "costs": "Gratisch",
    "costsEn": "Free",
    "description": "We gaan de GEWIS kas plunderen en al het geld verbranden!",
    "descriptionEn": "We\u0027re going to break open the GEWIS vault and burn all the money!",
    "attendees": [],
    "fields": 0
}, {
    "id": 4,
    "name": "BAC en AC integratie",
    "nameEn": "BAC and AC merger",
    "beginTime": {
        "date": "2015-05-05 05:05:05.000000",
        "timezone_type": 3,
        "timezone": "Europe\/Berlin"
    },
    "endTime": {
        "date": "2015-05-06 05:05:05.000000",
        "timezone_type": 3,
        "timezone": "Europe\/Berlin"
    },
    "location": "GEWIS",
    "LocationEn": "GEWIS",
    "costs": "\u221e",
    "costsEn": "\u221e",
    "description": "Voor deze fantastische prijs komt er de nieuwe innovatie bij GEWIS! De BAC de AC zullen zich samenvoegen tot een commissie!\r\n\r\nDit zorgt natuurlijk voor veel meer eenheid bij GEWIS en zal 100% meer (*) conflicten tussen commissies oplossen!\r\n\r\n(*) natuurlijk zal dit binnen commissies alleen maar meer conflict geven",
    "descriptionEn": "See the dutch version! We don\u0027t do english with this!",
    "attendees": [],
    "fields": 0
}]

Photos

/api/photo/album/:album_id

Returns information about the album with the given ID. Also includes photo's.

Example:

{
    "album": {
        "id": 3,
        "startDateTime": {
            "date": "2015-10-22 16:33:00.000000",
            "timezone_type": 3,
            "timezone": "Europe\/Amsterdam"
        },
        "endDateTime": {
            "date": "2015-12-21 13:18:02.000000",
            "timezone_type": 3,
            "timezone": "Europe\/Amsterdam"
        },
        "name": "BAC Shotjesborrel",
        "parent": null,
        "children": [],
        "photos": [],
        "coverPath": "a0\/a94d920a5beba7cd6e9702b75a9b95049eecff.png",
        "photoCount": 59,
        "albumCount": 0
    },
    "basedir": "\/data\/photo",
    "photos": [{
        "id": 206,
        "dateTime": {
            "date": "2015-10-22 18:18:13.000000",
            "timezone_type": 3,
            "timezone": "Europe\/Amsterdam"
        },
        "artist": "Pieter Kokx \/ GEFLITST",
        "camera": "NIKON D5300",
        "flash": false,
        "focalLength": 23,
        "exposureTime": 0.05,
        "shutterSpeed": "1\/20s",
        "aperture": "f\/2.8",
        "iso": 1250,
        "album": {
            "id": 3,
            "startDateTime": {
                "date": "2015-10-22 16:33:00.000000",
                "timezone_type": 3,
                "timezone": "Europe\/Amsterdam"
            },
            "endDateTime": {
                "date": "2015-12-21 13:18:02.000000",
                "timezone_type": 3,
                "timezone": "Europe\/Amsterdam"
            },
            "name": "BAC Shotjesborrel",
            "parent": null,
            "children": [],
            "photos": [],
            "coverPath": "a0\/a94d920a5beba7cd6e9702b75a9b95049eecff.png",
            "photoCount": 59,
            "albumCount": 0
        },
        "path": "e3\/776bd019e4d6fcb3075c5971a71bc981261006.jpeg",
        "smallThumbPath": "dc\/a30e42d83415359275feec284b1fa867ddd727.png",
        "largeThumbPath": "dc\/a30e42d83415359275feec284b1fa867ddd727.png"
    }, {
        "id": 207,
        "dateTime": {
            "date": "2015-10-22 18:17:16.000000",
            "timezone_type": 3,
            "timezone": "Europe\/Amsterdam"
        },
        "artist": "Pieter Kokx \/ GEFLITST",
        "camera": "NIKON D5300",
        "flash": false,
        "focalLength": 27,
        "exposureTime": 0.04,
        "shutterSpeed": "1\/25s",
        "aperture": "f\/2.8",
        "iso": 1250,
        "album": {
            "id": 3,
            "startDateTime": {
                "date": "2015-10-22 16:33:00.000000",
                "timezone_type": 3,
                "timezone": "Europe\/Amsterdam"
            },
            "endDateTime": {
                "date": "2015-12-21 13:18:02.000000",
                "timezone_type": 3,
                "timezone": "Europe\/Amsterdam"
            },
            "name": "BAC Shotjesborrel",
            "parent": null,
            "children": [],
            "photos": [],
            "coverPath": "a0\/a94d920a5beba7cd6e9702b75a9b95049eecff.png",
            "photoCount": 59,
            "albumCount": 0
        },
        "path": "3d\/1c85f8520bf03cf15398a70b22b3210730b81e.jpeg",
        "smallThumbPath": "52\/414a0a79b05b3911ff45873f2b0247c64a0dac.png",
        "largeThumbPath": "0f\/ab0aef3e1b98317976d1322ecd3e1e1f5307cb.png"
    }],
    "albums": []
}