From 8909ac57a8c0c02ce0b6bfabf5f47cafc955d464 Mon Sep 17 00:00:00 2001 From: Chewing_Bever Date: Sat, 13 May 2023 12:29:35 +0200 Subject: [PATCH] docs: start of api reference file --- affluences-api/API.md | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/affluences-api/API.md b/affluences-api/API.md index fc0ecd0..708641e 100644 --- a/affluences-api/API.md +++ b/affluences-api/API.md @@ -1,3 +1,45 @@ +# Affluences API Reference + +## Terminology + +* `site` + * General name for a location/institution + * Defined by a UUID and a slug, e.g. `ghent-university` + * Can contain one more or more sites, e.g. + `ghent-university-library-book-tower` is a child of `ghent-university` + +## Notes + +The API checks for browser user agents, so your requests should include a valid +user agent of a modern browser. + +## API Routes + +### Search for sites + +`GET https://api.affluences.com/app/v3/sites` + +**Body format** + +```json +{ + "selected_categories": [ + 1 + ], + "page": 0, + "search_query": "university of ghent" +} +``` + +**Response format** + +`Data>` + +### Retrieve time table for a given site + +`GET https://reservation.affluences.com/api/sites/4737e57a-ee05-4f7b-901a-7bb541eeb297` + + curl -L 'https://api.affluences.com/app/v3/sites/ghent-university' -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/112.0' returnt lijst van alle bibliotheken op ugent, inclusief de uuids die dan nodig zijn om de specifieke requests te sturen naar die bib zijn stuff