api.rst 3.56 KB
Newer Older
Cédric Bonhomme's avatar
Cédric Bonhomme committed
1
<<<<<<< HEAD
Cédric Bonhomme's avatar
Cédric Bonhomme committed
2
<<<<<<< HEAD
3 4
API
===
5

6
Examples of requests to the Web Service
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
--------------------------------------

.. code-block:: shell

    # Get the list of root categories
    $ GET http://127.0.0.1:5000/api/category?q={"filters":[{"name":"parent_id","op":"is_null"}]}
    # Get the list of child categories
    $ GET http://127.0.0.1:5000/api/category?q={"filters":[{"name":"parent_id","op":"is_not_null"}]}
    # Get information about the child category "Walls & Frame"
    $ GET http://127.0.0.1:5000/api/category?q={"filters":[{"name":"parent_id","op":"is_not_null"},{"name":"name","op":"eq","val":"Walls %26 frame"}]}

    # Get information about an attribute
    $ GET http://127.0.0.1:5000/api/attribute?q={"filters":[{"name":"name","op":"eq","val":"Landform"}]}
    $ GET http://127.0.0.1:5000/api/attribute?q={"filters":[{"name":"name","op":"eq","val":"Main hazards in country"}]}

    # Get the translations of a string
    $ GET http://127.0.0.1:5000/api/translation?q={"filters":[{"name":"original","op":"eq","val":"Name of shelter"}]}
Cédric Bonhomme's avatar
Cédric Bonhomme committed
24
=======
Cédric Bonhomme's avatar
Cédric Bonhomme committed
25
=======
Cédric Bonhomme's avatar
Cédric Bonhomme committed
26
>>>>>>> 56b170c62373521aae3518c6fece0335e0e06ec5
Maarten van der Veen's avatar
Maarten van der Veen committed
27 28 29 30
Web Services
============

Example of requests to the Web Service
Cédric Bonhomme's avatar
Cédric Bonhomme committed
31
<<<<<<< HEAD
Cédric Bonhomme's avatar
Cédric Bonhomme committed
32
>>>>>>> b6b3759e10b96db233dac9cadc04365ff404dd97
Cédric Bonhomme's avatar
Cédric Bonhomme committed
33 34
=======
>>>>>>> 19a939463af74c6008ef819369c07cfda36d9d34
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
--------------------------------------

.. code-block:: shell

    # Get the list of root categories
    $ GET http://127.0.0.1:5000/api/category?q={"filters":[{"name":"parent_id","op":"is_null"}]}
    # Get the list of child categories
    $ GET http://127.0.0.1:5000/api/category?q={"filters":[{"name":"parent_id","op":"is_not_null"}]}
    # Get information about the child category "Walls & Frame"
    $ GET http://127.0.0.1:5000/api/category?q={"filters":[{"name":"parent_id","op":"is_not_null"},{"name":"name","op":"eq","val":"Walls %26 frame"}]}

    # Get information about an attribute
    $ GET http://127.0.0.1:5000/api/attribute?q={"filters":[{"name":"name","op":"eq","val":"Landform"}]}
    $ GET http://127.0.0.1:5000/api/attribute?q={"filters":[{"name":"name","op":"eq","val":"Main hazards in country"}]}

    # Get the translations of a string
    $ GET http://127.0.0.1:5000/api/translation?q={"filters":[{"name":"original","op":"eq","val":"Name of shelter"}]}
Cédric Bonhomme's avatar
Cédric Bonhomme committed
52
<<<<<<< HEAD
Cédric Bonhomme's avatar
Cédric Bonhomme committed
53
<<<<<<< HEAD
Cédric Bonhomme's avatar
Cédric Bonhomme committed
54
=======
Maarten van der Veen's avatar
Maarten van der Veen committed
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
Web Services
============

Example of requests to the Web Service
--------------------------------------

.. code-block:: shell

    # Get the list of root categories
    $ GET http://127.0.0.1:5000/api/category?q={"filters":[{"name":"parent_id","op":"is_null"}]}
    # Get the list of child categories
    $ GET http://127.0.0.1:5000/api/category?q={"filters":[{"name":"parent_id","op":"is_not_null"}]}
    # Get information about the child category "Walls & Frame"
    $ GET http://127.0.0.1:5000/api/category?q={"filters":[{"name":"parent_id","op":"is_not_null"},{"name":"name","op":"eq","val":"Walls %26 frame"}]}

    # Get information about an attribute
    $ GET http://127.0.0.1:5000/api/attribute?q={"filters":[{"name":"name","op":"eq","val":"Landform"}]}
    $ GET http://127.0.0.1:5000/api/attribute?q={"filters":[{"name":"name","op":"eq","val":"Main hazards in country"}]}

    # Get the translations of a string
    $ GET http://127.0.0.1:5000/api/translation?q={"filters":[{"name":"original","op":"eq","val":"Name of shelter"}]}
Cédric Bonhomme's avatar
Cédric Bonhomme committed
76
>>>>>>> 011351c71fefe44d232b84497307f51ee6d5b501
Cédric Bonhomme's avatar
Cédric Bonhomme committed
77 78
=======
>>>>>>> b6b3759e10b96db233dac9cadc04365ff404dd97
Cédric Bonhomme's avatar
Cédric Bonhomme committed
79
=======
Cédric Bonhomme's avatar
Cédric Bonhomme committed
80
>>>>>>> 011351c71fefe44d232b84497307f51ee6d5b501
Cédric Bonhomme's avatar
Cédric Bonhomme committed
81 82
=======
>>>>>>> 56b170c62373521aae3518c6fece0335e0e06ec5
Cédric Bonhomme's avatar
Cédric Bonhomme committed
83
>>>>>>> 19a939463af74c6008ef819369c07cfda36d9d34