Skip to content

Commit

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

``(implementation of Application entity)``

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

* `Get application`_
* `Get applications`_
* `Save application`_
* `Save applications`_
* `Update application`_
* `Delete application`_
* `Get application or applications by name`_

.. _`Get application`:

Expand All @@ -33,43 +35,61 @@ Parameters response:
*Object*

*With properties:*
#. id (Number)
#. decision (Object)
#. create_date (Number)
#. update_date (Number)
#. application_form (Object)
#. submitted_user (Object)
#. regarding_user (Object)
#. registration_number (Number)
#. handled_user (Object)

.. note::

decision relates to Decision entity

*_date represent as number of seconds since 1 Jan 1970 00:00:00 (UTC)
application_form relates to ApplicationForm entity

submitted_user, regarding_user relate to User entity

handled_user relates to Person
#. id(NUMBER)
#. create_date(NUMBER)
#. update_date(NUMBER)
#. application_form(OBJECT)
type of `ApplicationForm <http://docs.ivis.se/en/latest/api/applicationform.html>`_
#. submitted_user(OBJECT)
type of `User <http://docs.ivis.se/en/latest/api/user.html>`_
#. regarding_user(OBJECT)
type of `User <http://docs.ivis.se/en/latest/api/user.html>`_
#. registration_number(NUMBER)
#. decision(OBJECT)
type of `Decision <http://docs.ivis.se/en/latest/api/decision.html>`_
#. handled_user(OBJECT)
type of `Person <http://docs.ivis.se/en/latest/api/person.html>`_

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

.. code-block:: json
{
"id":1,
"decision":{},
"create_date":1461239571000,
"update_date":1461297884000,
"application_form":{},
"submitted_user":{},
"regarding_user":{},
"registration_number":1111,
"handled_user":{}
"id" : 0,
"create_date" : 1477474353064,
"update_date" : 1477474353064,
"application_form" : {
"id" : null,
"name" : null,
"version" : null,
"steps" : [ ]
},
"submitted_user" : {
"id" : null,
"name" : null,
"person" : null,
"roles" : [ ],
"saml2_id" : null
},
"regarding_user" : {
"id" : null,
"name" : null,
"person" : null,
"roles" : [ ],
"saml2_id" : null
},
"registration_number" : 0,
"decision" : null,
"handled_user" : {
"id" : null,
"personal_id" : null,
"first_name" : null,
"last_name" : null,
"addresses" : { },
"emails" : { },
"phones" : { }
}
}
.. _`Get applications`:
Expand All @@ -94,21 +114,8 @@ Parameters response:
*Array*

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

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

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

Save application
----------------
Expand All @@ -123,18 +130,37 @@ Method:

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

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

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

Save applications
-----------------

URL:
~~~~
*/applications*

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

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

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

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

.. _`Update application`:

Expand All @@ -151,21 +177,20 @@ Method:

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

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

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

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

.. note::

property will be updated, if you don't want update property it need set null

.. _`Delete application`:

Delete applicationForm
----------------------
Delete application
------------------

URL:
~~~~
Expand All @@ -181,5 +206,31 @@ Parameters request:

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

.. note::

you receive deleted object

.. _`Get application or applications by name`:

Get application or applications by name
---------------------------------------

URL:
~~~~
*/applications*

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

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

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

0 comments on commit b4020d7

Please sign in to comment.