API - digitalfabrik/coldaid-backend GitHub Wiki
Accommodations
The accommodations endpoint can be found at the following url:
/api/<region_slug>/<language_code>/accommodations
As an example for the cms running on localhost the url for the region Augsburg in English could look like this:
GET localhost:8000/api/augsburg/en-us/accommodations
The reply will be a JSON list of all accommodations of the region with the following fields:
name (String)
: The name of the accommodationcurrent_language (String)
: The currently displayed language of the current accommodation (as language code). If the accommodation doesn't have the language that was requested by request then it falls back to the default language of the region the accommodation belongs to. So it could happen that an accommodation will be displayed in German even though it was requested in English because of this.description (HTML)
: The description of the accommodation as html markup since the description is a rich text field with formatting and styling.short_description (String)
: This field is the short description of the accommodationopening_hours (Object)
:from (String)
: Time string of the start of the opening time in formathh:mm:ss
(24 hour format)to (String)
: Time string of the closing time of the accommodation in formathh:mm:ss
(24 hour format)
intake_hours (Object)
:from (String)
: Time string of the start of the intake timeframe in formathh:mm:ss
(24 hour format)to (String)
: Time string of the ending of the intake timeframe of the accommodation in formathh:mm:ss
(24 hour format)
address (Object)
:street (String)
plz (String)
city (String)
geo (Object)
: the geolocationlat (float)
: the latitudelong (float)
: the longitude
phone (Object)
home (String)
mobile (String)
sanitary_amenities (Object)
wc (bool)
: if toilets are availableshower (bool)
: if showers are available
rules (Object)
: List of rules currently hard coded could get more fields in future versionsanimals (bool)
: if animals are allowedshelter_seeking_person_intoxicated (bool)
: if intoxiated people are allowedfemale_only (bool)
: if the accommodation is female onlyfamilies_welcome (bool)
: if families are allowed in the accommodationmale_only (bool)
: if the accommodation is male onlykids_welcome (bool)
: if kids are allowed in the accommodation
spoken_languages (List)
: the languages spoken in the accommodation is an array list where the objects have the following fields:translated (String)
: language as it is translated into Englishcode (String)
: the language code (en-us for english or de-de for German for example)native (String)
: the native name of the language (Deutsch for German for example)
institution (Object)
: the institution the accommodation belongs toslug (String)
: a unique name of the accommodation can be used to build a link to the infoname (String)
: name of the institutionthumbnail (String)
: link to the thumbnail of the organization
beds
target_group (String)
: the target group for this bed (i.e. female, male, with animals etc)num_beds (integer)
: the total amounts of beds availablenum_free_beds (integer)
: the number of beds that are currently free
Regions
The regions endpoint can be found at the following url:
/api/regions/
will return a list of regions in the systems with the following fields.
id (integer)
: The id of the regionname (string)
: The name of the regionpath (string)
: The slug of the region or identifiable name used in the url (used for inserting wherever<region_slug>
) is asked in the apiadministrative_division (string)
: the administrative division of the current region (for example City)postal_code (string)
: The postal codelongitude (float)
: The longitude geo coordinate of the rough center of the regionlangitude (float)
: The langitude geo coordinate of the rough center of the region
Languages
The languages endpoint can be found at the following url:
/api/<region_slug>/languages
displays all languages of a region
id (integer)
: The id of the languagecode (string)
: The language code in the format language-country (e.g. "de-de" or "en-us")native_name (string)
: The language's native nameenglish_name (string)
: The name of the language in englishtext_direction (string)
: The text direction, either "ltr" or "rtl"