Skip to content

Commit

Permalink
add all entities to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
RuslanPopenko committed Jun 21, 2016
1 parent f30fe15 commit a867740
Show file tree
Hide file tree
Showing 10 changed files with 600 additions and 2 deletions.
195 changes: 195 additions & 0 deletions docs/api/activities.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,195 @@
Activities
==========

``(implementation of Activity entity)``

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

* `Get activity`_
* `Get activities`_
* `Save activity`_
* `Attach file to activity`_
* `Download attached file`_

.. _`Get activity`:

Get activity
------------

URL:
~~~~
*/activities/{id}*

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

Parameters request:
~~~~~~~~~~~~~~~~~~~
*null*

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

*With properties:*
#. id (Number)
#. description (String)
#. reported_date (Number)
#. reported_by (Object)
#. file_name (String)
#. issue (Object)

.. note::

reported_by links with Person entity

reported_date represent as number of seconds since 1 Jan 1970 00:00:00 (UTC)

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

.. code-block:: json
{
"id":1,
"description":"Test",
"reported_date":1465828993000,
"reported_by":{},
"issue":{},
"file_name":"file.pdf",
}
.. _`Get activities`:

Get activities
--------------

URL:
~~~~
*/activities*

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

Parameters request:
~~~~~~~~~~~~~~~~~~~
*null*

Parameters response:
~~~~~~~~~~~~~~~~~~~~
*Array*

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

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

.. code-block:: json
[
{},
{},
...
{}
]
.. _`Save activity`:

Save activity
-------------

URL:
~~~~
*/activities*

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

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

*With properties:*
#. description (String)
#. issue (Object)

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

*On server fill properties*
#. id (Number)
#. reported_date (Number)
#. reported_by (Object)

.. note::
You retrieve whole object just like in `Get activity`_

Example of request:
~~~~~~~~~~~~~~~~~~~

.. code-block:: json
{
"description" : "Test",
"issue" : { id : 1 }
}
.. _`Attach file to activity`:

Attach file to activity
-----------------------

URL:
~~~~
*/activities/attach/{id}*

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

Parameters request:
~~~~~~~~~~~~~~~~~~~
*One file*

*With property* **name = "file"**

.. note::
Max file size can not be more than 20 Mb

When you upload file -> on server fill file_name property with appropriate activity

Parameters response:
~~~~~~~~~~~~~~~~~~~~
*String*

*Description:* file name of attached file

.. _`Download attached file`:

URL:
~~~~
*/activities/attach/{id}*

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

Parameters request:
~~~~~~~~~~~~~~~~~~~
*null*

Parameters response:
~~~~~~~~~~~~~~~~~~~~
*File*

*Description:* starting download a file





44 changes: 44 additions & 0 deletions docs/api/categories.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
Categories
==========

``(implementation of Category entity)``

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

* `Get categories`_

.. _`Get categories`:

Get categories
--------------

URL:
~~~~
*/categories/{id}*

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

Parameters request:
~~~~~~~~~~~~~~~~~~~
*null*

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

*With properties:*

#. id (Number)
#. name (String)

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

.. code-block:: json
{
"id":1,
"name" : "category"
}
2 changes: 1 addition & 1 deletion docs/api/incidents.rst
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ Example of response:
{},
...
{}
}
]
.. _`Get incidents list`:

Expand Down
1 change: 1 addition & 0 deletions docs/api/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ You can have access and operate with following entities
categories
statuses
persons
users
schools
schoolclasses
applications
Expand Down
2 changes: 1 addition & 1 deletion docs/api/issues.rst
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ Example of response:
{},
...
{}
}
]
.. _`Get issues list`:

Expand Down
121 changes: 121 additions & 0 deletions docs/api/persons.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
Persons
=======

``(implementation of Person entity)``

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

* `Get person`_
* `Get persons`_
* `Get persons list`_ (by some criteria)

.. _`Get person`:

Get issue
---------

URL:
~~~~
*/persons/{id}*

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

Parameters request:
~~~~~~~~~~~~~~~~~~~
*null*

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

*With properties:*
#. id (Number)
#. first_name (String)
#. last_name (String)
#. personal_id (String)
#. addresses (Object)
#. emails (Object)
#. phones (Object)

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

.. code-block:: json
{
"id": 1,
"addresses": {},
"emails": {},
"phones": {},
"personal_id": "number-1111",
"first_name": "Test",
"last_name": "Test"
}
.. _`Get persons`:

Get persons
-----------

URL:
~~~~
*/persons*

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

Parameters request:
~~~~~~~~~~~~~~~~~~~
*null*

Parameters response:
~~~~~~~~~~~~~~~~~~~~
*Array*

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

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

.. code-block:: json
[
{},
{},
...
{}
]
.. _`Get persons list`:

Get persons list
----------------

URL:
~~~~
*/persons*

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

Parameters request:
~~~~~~~~~~~~~~~~~~~
* *search_text*
* *order_by*

.. note::
Search in last name, or first name

order_by can be: "last_name", "first_name"

Parameters response:
~~~~~~~~~~~~~~~~~~~~
*Array*

.. note::
Array structure the same as `Get persons`_

0 comments on commit a867740

Please sign in to comment.