Skip to content

Commit

Permalink
IVIS-46: - Update API chapter.
Browse files Browse the repository at this point in the history
  • Loading branch information
RuslanPopenko committed Oct 26, 2016
1 parent 861b37a commit f0bd3ee
Show file tree
Hide file tree
Showing 7 changed files with 294 additions and 58 deletions.
59 changes: 59 additions & 0 deletions docs/api/application.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
List of properties from Application
===================================

#. 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" : 0,
"create_date" : 1477474353027,
"update_date" : 1477474353027,
"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" : { }
}
}
23 changes: 23 additions & 0 deletions docs/api/applicationform.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
List of properties from ApplicationForm
=======================================

#. id(NUMBER)
#. name(STRING)
#. version(NUMBER)
#. steps(ARRAY)
type of `ApplicationFormStep <http://docs.ivis.se/en/latest/api/applicationformstep.html>`_
#. applications(ARRAY)
type of `Application <http://docs.ivis.se/en/latest/api/application.html>`_

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

.. code-block:: json
{
"id" : 0,
"name" : "",
"version" : 0,
"steps" : [ ],
"applications" : null
}
43 changes: 43 additions & 0 deletions docs/api/applicationformquestion.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
List of properties from ApplicationFormQuestion
===============================================

#. id(NUMBER)
#. name(STRING)
#. sort_order(NUMBER)
#. text(STRING)
#. value(STRING)
#. multi_values(BOOLEAN)
#. values(ARRAY)
type of STRING
#. multi_variants(BOOLEAN)
#. variants(ARRAY)
type of STRING
#. question_type(STRING)
#. question_group(OBJECT)
type of `ApplicationFormQuestionGroup <http://docs.ivis.se/en/latest/api/applicationformquestiongroup.html>`_

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

.. code-block:: json
{
"id" : 0,
"name" : "",
"sort_order" : 0,
"text" : "",
"value" : "",
"multi_values" : false,
"values" : [ ],
"multi_variants" : false,
"variants" : [ ],
"question_type" : "",
"question_group" : {
"id" : null,
"name" : null,
"sort_order" : null,
"text" : null,
"question_type" : null,
"step" : null
}
}
33 changes: 33 additions & 0 deletions docs/api/applicationformquestiongroup.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
List of properties from ApplicationFormQuestionGroup
====================================================

#. id(NUMBER)
#. name(STRING)
#. sort_order(NUMBER)
#. text(STRING)
#. questions(ARRAY)
type of STRING
#. question_type(STRING)
#. step(OBJECT)
type of `ApplicationFormStep <http://docs.ivis.se/en/latest/api/applicationformstep.html>`_

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

.. code-block:: json
{
"id" : 0,
"name" : "",
"sort_order" : 0,
"text" : "",
"questions" : [ ],
"question_type" : "",
"step" : {
"id" : null,
"name" : null,
"sort_order" : null,
"text" : null,
"application_form" : null
}
}
147 changes: 89 additions & 58 deletions docs/api/applicationformquestiongroups.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@

``(implementation of ApplicationFormQuestionGroup entity)``

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

* `Get applicationFormQuestionGroup`_
* `Get applicationFormQuestionGroups`_
* `Save applicationFormQuestionGroup`_
* `Save applicationFormQuestionGroups`_
* `Update applicationFormQuestionGroup`_
* `Delete applicationFormQuestionGroup`_
* `Get applicationFormQuestionGroup or applicationFormQuestionGroups by name`_

.. _`Get applicationFormQuestionGroup`:

Expand All @@ -33,42 +35,40 @@ Parameters response:
*Object*

*With properties:*
#. id (Number)
#. name (String)
#. sort_order (Number)
#. text (String)
#. questions (Array)
#. question_type (String)
#. step (Array)

.. note::

sort_order represent unique number according to sort purpose

questions relate to ApplicationFormQuestion entity

question_type - full class name which responds for question

step relates to ApplicationFormStep entity
#. id(NUMBER)
#. name(STRING)
#. sort_order(NUMBER)
#. text(STRING)
#. questions(ARRAY)
type of `ApplicationFormQuestion <http://docs.ivis.se/en/latest/api/applicationformquestion.html>`_
#. question_type(STRING)
#. step(OBJECT)
type of `ApplicationFormStep <http://docs.ivis.se/en/latest/api/applicationformstep.html>`_

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

.. code-block:: json
{
"id":1,
"name":"Name",
"sort_order":1,
"text":"Definition",
"questions":[],
"question_type":"com.imcode.ClassName",
"step":{}
"id" : 0,
"name" : "",
"sort_order" : 0,
"text" : "",
"questions" : [ ],
"question_type" : "",
"step" : {
"id" : null,
"name" : null,
"sort_order" : null,
"text" : null,
"application_form" : null
}
}
.. _`Get applicationFormQuestionGroups`:
.. _`Get applicationformquestiongroups`:

Get applicationFormQuestionGroups
Get applicationformquestiongroups
---------------------------------

URL:
Expand All @@ -88,24 +88,34 @@ Parameters response:
*Array*

.. seealso::

Array consists of objects from `Get applicationFormQuestionGroup`_ method

Example of response:
~~~~~~~~~~~~~~~~~~~~
Save applicationFormQuestionGroup
---------------------------------

.. code-block:: json
URL:
~~~~
*/applicationformquestiongroups*

[
{},
{},
...
{}
]
Method:
~~~~~~~
*POST*

.. _`Save applicationFormQuestionGroup`:
Parameters request:
~~~~~~~~~~~~~~~~~~~
*OBJECT(ApplicationFormQuestionGroup)*

Save applicationFormQuestionGroup
-----------------------------------
Parameters response:
~~~~~~~~~~~~~~~~~~~~
*OBJECT(ApplicationFormQuestionGroup)*

Null properties:
~~~~~~~~~~~~~~~~
*id*

Save applicationformquestiongroups
----------------------------------

URL:
~~~~
Expand All @@ -117,20 +127,16 @@ Method:

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

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

.. seealso::
Whole properties list you can see at `Get applicationFormQuestionGroup`_
*Array(ApplicationFormQuestionGroup)*

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

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

.. _`Update applicationFormQuestionGroups`:
.. _`Update applicationFormQuestionGroup`:

Update applicationFormQuestionGroup
-----------------------------------
Expand All @@ -145,18 +151,17 @@ Method:

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

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

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

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

.. _`Delete applicationFormQuestionGroups`:
.. note::

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

.. _`Delete applicationFormQuestionGroup`:

Delete applicationFormQuestionGroup
-----------------------------------
Expand All @@ -175,5 +180,31 @@ Parameters request:

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

.. note::

you receive deleted object

.. _`Get applicationFormQuestionGroup or applicationFormQuestionGroups by name`:

Get applicationFormQuestionGroup or applicationFormQuestionGroups by name
-------------------------------------------------------------------------

URL:
~~~~
*/applicationformquestiongroups*

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

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

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

0 comments on commit f0bd3ee

Please sign in to comment.