api_v0.1.rst 1.62 KB
Newer Older
Aron Gergely's avatar
Aron Gergely committed
1 2 3 4 5
Web Services
============

Usage of the development API v0.1
---------------------------------
6
request parameters:
7
	**attribute**: pass one or more attribute names, such as `<attribute=Name,Vegetation>`
8
	NOTE: Currently the attribute names may contain capital letters and spaces.
9 10
	Spaces should be substituted as `<%20>` int the URL, for example
	`<Climate%20Zone>`. An alternative "coding-friendly" attribute naming will be implemented shortly,
11
	as unique strings for each attribute whithout spaces and upper case letters.
12 13
	
	**format**: use `<format=prettytext>` to get the nicely formatted attribute names in the JSON,
14 15
	instead of the "coding-friendly" attribute names.
	
Aron Gergely's avatar
Aron Gergely committed
16

17
Examples:
18

Aron Gergely's avatar
Aron Gergely committed
19 20 21 22 23 24 25 26 27 28 29
.. code-block:: shell
    
    http://0.0.0.0:5000/api/v0.1
    # Welcome message and version info
    
    http://0.0.0.0:5000/api/v0.1/shelters
    # Get all shelters and their attributes
    
    http://0.0.0.0:5000/api/v0.1/shelters/3
    # Get a specific shelter via shelter ID
    
30 31 32 33 34 35
    http://0.0.0.0:5000/api/v0.1/shelters?attribute=Vegetation
    # Get all shelters which have an atttribute value for "Vegetation"
    
    http://0.0.0.0:5000/api/v0.1/shelters?attribute=vegetation&format=prettytext
    # Get all shelters which have an atttribute value for "Vegetation", with  nicely formatted attribute names
    
Aron Gergely's avatar
Aron Gergely committed
36 37
    http://0.0.0.0:5000/api/v0.1/attributes/Climate zone
    # Get all available values of an attribute
38 39 40 41 42 43
    
    http://0.0.0.0:5000/api/v0.1/shelters/Kitchen type
    #get all shelters which have a specific attribute
    
    http://0.0.0.0:5000/api/v0.1/shelters/Kitchen type/open fire
    #get all shelters which have a specific attribute value