Skip to content

Commit

Permalink
IVIS-46: - Update API chapter (schools).
Browse files Browse the repository at this point in the history
  • Loading branch information
RuslanPopenko committed Oct 26, 2016
1 parent 87921d3 commit 1e37c7b
Showing 1 changed file with 76 additions and 47 deletions.
123 changes: 76 additions & 47 deletions docs/api/schools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@

``(implementation of School entity)``

Provides following methods for `API <index.html>`_ calls:
Provides following method for `API <index.html>`_ calls:

* `Get school`_
* `Get schools`_
* `Save school`_
* `Save schools`_
* `Update school`_
* `Delete school`_
* `Get school or schools by name`_

.. _`Get school`:

Expand All @@ -33,29 +35,25 @@ Parameters response:
*Object*

*With properties:*
#. id (Number)
#. name (String)
#. school_id (String)
#. school_classes (Array)
#. after_school_center_sections (Array)

.. note::

school_classes relates to SchoolClass entity

after_school_center_sections relates to afterSchoolCenterSections entity
#. id(NUMBER)
#. name(STRING)
#. school_id(STRING)
#. school_classes(ARRAY)
type of `SchoolClass <http://docs.ivis.se/en/latest/api/schoolclass.html>`_
#. after_school_center_sections(ARRAY)
type of `AfterSchoolCenterSection <http://docs.ivis.se/en/latest/api/afterschoolcentersection.html>`_

Example of response:
~~~~~~~~~~~~~~~~~~~~

.. code-block:: json
{
"id":1,
"name":"Name",
"school_id":"1111-id",
"school_classes":[],
"after_school_center_sections":[]
"id" : 0,
"name" : "",
"school_id" : "",
"school_classes" : {},
"after_school_center_sections" : {}
}
.. _`Get schools`:
Expand All @@ -80,21 +78,8 @@ Parameters response:
*Array*

.. seealso::
Array consists of objects from `Get school`_ method

Example of response:
~~~~~~~~~~~~~~~~~~~~

.. code-block:: json
[
{},
{},
...
{}
]
.. _`Save school`:
Array consists of objects from `Get school`_ method

Save school
-----------
Expand All @@ -109,18 +94,37 @@ Method:

Parameters request:
~~~~~~~~~~~~~~~~~~~
*Object*
*OBJECT(School)*

*With properties what you want to create, except id*
Parameters response:
~~~~~~~~~~~~~~~~~~~~
*OBJECT(School)*

.. seealso::
Whole properties list you can see at `Get school`_
Null properties:
~~~~~~~~~~~~~~~~
*id*

Save schools
------------

URL:
~~~~
*/schools*

Method:
~~~~~~~
*POST*

Parameters request:
~~~~~~~~~~~~~~~~~~~
*Array(School)*

Parameters response:
~~~~~~~~~~~~~~~~~~~~
*Object*

*On server fill id*
*Array(School)*
Null properties of every object in array:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*id*

.. _`Update school`:

Expand All @@ -137,18 +141,17 @@ Method:

Parameters request:
~~~~~~~~~~~~~~~~~~~
*Object*

*With properties what you want to update, except id*

.. seealso::
Whole properties list you can see at `Get school`_
*OBJECT(School)*

Parameters response:
~~~~~~~~~~~~~~~~~~~~
*Object*
*OBJECT(School)*

.. note::

.. _`Delete school`:
property will be updated, if you don't want update property it need set null

.. _`Delete school`:

Delete school
-------------
Expand All @@ -167,5 +170,31 @@ Parameters request:

Parameters response:
~~~~~~~~~~~~~~~~~~~~
*Object*
*OBJECT(School)*

.. note::

you receive deleted object

.. _`Get school or schools by name`:

Get school or schools by name
-----------------------------

URL:
~~~~
*/schools*

Method:
~~~~~~~
*GET*

Parameters request:
~~~~~~~~~~~~~~~~~~~
*name(STRING)*
and optional *first(BOOLEAN)*

Parameters response:
~~~~~~~~~~~~~~~~~~~~
*ARRAY or OBJECT (School)*

0 comments on commit 1e37c7b

Please sign in to comment.