csv_web_service.rst 2.03 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
.. _csv-web-service-directory:

***************************
CSV Web service directories
***************************

The data returned by the Web service must have the same format than the file directory. In the same
way, you will be able to choose the headers and the separator in the next step.

This directory type matches the :ref:`dird-backend-csv_ws` backend in `xivo-dird`.

For web service directories, the :guilabel:`Direct match` and the :guilabel:`Match reverse
directories` must be filled with the name of the HTTP query parameter that will be used when doing
the HTTP requests.

Note that the CSV returned by the Web service is not further processed.

18 19
Manual configuration needs to be done to use a secure (SSL) connection.
See :ref:`dird-backend-csv_ws` for more details.
20

21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51

Available fields
================

Available fields are the ones contained in the CSV result.


Example
=======

http://example.org:8000/ws-phonebook return csv::

    title|firstname|lastname|displayname|society|phone|email
    mr|Emmett|Brown|Brown Emmett|DMC|5555551234|[email protected]
    ms|Alice|Wonderland|Wonderland Alice|DMC|5555551235|[email protected]


Adding a source
---------------

.. figure:: images/xivo_add_directory_csv_web_service.png

   :menuselection:`Configuration --> Management --> Directories`


Configuring source access
-------------------------

Given you have the following directory definition:

* :guilabel:`Direct match` : ``search``
52
* :guilabel:`Match reverse directories` : ``phone``
53 54 55 56 57 58 59

When a direct lookup for "Alice" is performed, then the following HTTP request::

   GET /ws-phonebook?search=Alice HTTP/1.1

is emitted. When a reverse lookup for "5555551234" is performed, then the following HTTP request::

60
   GET /ws-phonebook?phone=5555551234 HTTP/1.1
61

62 63
is emitted. On the reverse lookup, a filtering is performed on the result. In this example, it should have
``phone`` as column.
64 65 66 67

.. figure:: images/xivo_configure_directory_csv_web_service.png

   :menuselection:`Services --> CTI Server --> Directories --> Definitions`