Commit 4581129a authored by Vojtech Sodoma's avatar Vojtech Sodoma

2293 Recording api was moved to /recording

parent 53fa9298
......@@ -4,19 +4,22 @@ Recording server REST Api
This section describes the Recording server API.
In the following, all url are relative to the recording server base url and port. For example a relative URL ``/records/search`` is meant to be replaced by ``http://192.168.29.101:9400/records/search`` assuming the recording server is available on port ``9400`` at ``192.168.29.101``
In the following, all urls are relative to the recording server base url and port. For example a relative URL
``/recording/records/search`` is meant to be replaced by ``http://192.168.29.101:9400/recording/records/search``
assuming the recording server is available on port ``9400`` at ``192.168.29.101``
Authentication
==============
To use the recording api you need to add an additional header in the HTTP Request. The header name is ``X-Auth-Token`` and its value must be the same as the ``authentication.token`` value in the ``application.conf`` of the recording server.
To use the recording api you need to add an additional header in the HTTP Request. The header name is ``X-Auth-Token``
and its value must be the same as the ``authentication.token`` value in the ``application.conf`` of the recording server.
Example:
::
curl -XPOST -H "Content-Type: application/json" -H "Accept: application/json"
-H 'X-Auth-Token: u@pf#41[gYHJm<]9N[a0iWDQQ7`e9k' http://192.168.29.101:9400/records/search?pageSize=3 -d '{"agent": "1573"}'
-H 'X-Auth-Token: u@pf#41[gYHJm<]9N[a0iWDQQ7`e9k' http://192.168.29.101:9400/recording/records/search?pageSize=3 -d '{"agent": "1573"}'
......@@ -30,7 +33,7 @@ This api allows to search for recorded calls in the database using criteria.
**Description:**
:URL: ``/records/search``
:URL: ``/recording/records/search``
:Method: ``POST``
:Url parameters:
:page: The page number to return, counting from 1
......@@ -58,7 +61,7 @@ This api allows to search for recorded calls in the database using criteria.
Query::
curl -XPOST -H "Content-Type: application/json" -H "Accept: application/json"
-H 'X-Auth-Token: u@pf#41[gYHJm<]9N[a0iWDQQ7`e9k' http://192.168.29.101:9400/records/search?pageSize=3 -d '{"agent": "1573"}'
-H 'X-Auth-Token: u@pf#41[gYHJm<]9N[a0iWDQQ7`e9k' http://192.168.29.101:9400/recording/records/search?pageSize=3 -d '{"agent": "1573"}'
Response::
......@@ -102,7 +105,7 @@ This api allows to search for a recorded call based on call id.
**Description:**
:URL: ``/records/callid_search``
:URL: ``/recording/records/callid_search``
:Method: ``POST``
:Url parameters:
:callid: The call id to retrieve
......@@ -113,7 +116,7 @@ This api allows to search for a recorded call based on call id.
Query::
curl -XPOST -H "Accept: application/json"
-H 'X-Auth-Token: u@pf#41[gYHJm<]9N[a0iWDQQ7`e9k' http://192.168.29.101:9400/records/callid_search?callid=1459435466.286075
-H 'X-Auth-Token: u@pf#41[gYHJm<]9N[a0iWDQQ7`e9k' http://192.168.29.101:9400/recording/records/callid_search?callid=1459435466.286075
Response::
......@@ -143,7 +146,7 @@ This api allows to get metadata or retrieve audio file of a given call. Each act
**Description:**
:URL: ``/records/records/<file-id>/audio/<action>``
:URL: ``/recording/records/<file-id>/audio/<action>``
:Method: ``GET``
:Url parameters:
:file-ud: The file to retrieve
......@@ -162,7 +165,7 @@ This api allows to get metadata or retrieve audio file of a given call. Each act
**Example**::
curl -XGET -H "Accept: application/json" -H 'X-Auth-Token: u@pf#41[gYHJm<]9N[a0iWDQQ7`e9k'
http://192.168.29.101:9400/records/xivocc_gateway-1459435465.15089/audio/download
http://192.168.29.101:9400/recording/records/xivocc_gateway-1459435465.15089/audio/download
Attach call data
......@@ -172,7 +175,7 @@ This api allows to attach data to a given call
**Description:**
:URL: ``/call_data/<call-data-id>/attached_data``
:URL: ``/recording/call_data/<call-data-id>/attached_data``
:Method: ``POST``
:Url parameters:
:call-data-id: The id of the call-data, not to be confused by the call id or unique id.
......@@ -183,7 +186,7 @@ This api allows to attach data to a given call
**Example**::
curl -XPOST -H "Content-Type: application/json" -H "Accept: application/json" -H 'X-Auth-Token: u@pf#41[gYHJm<]9N[a0iWDQQ7`e9k'
http://192.168.29.101:9400/call_data/761054/attached_data -d '[{"key":"color", "value": "green"}]'
http://192.168.29.101:9400/recording/call_data/761054/attached_data -d '[{"key":"color", "value": "green"}]'
History
=======
......@@ -195,7 +198,7 @@ This api gives the call history of a given interface.
**Description:**
:URL: ``/history``
:URL: ``/recording/history``
:Method: ``POST``
:Url parameters:
:size: The maximum number of result to return
......@@ -206,7 +209,7 @@ This api gives the call history of a given interface.
**Example**
Query::
curl -XPOST -H "Content-Type: application/json" -H "Accept: application/json" -H 'X-Auth-Token: u@pf#41[gYHJm<]9N[a0iWDQQ7`e9k' http://localhost:9400/history -d '{"interface":"SIP/az9kf7"}'
curl -XPOST -H "Content-Type: application/json" -H "Accept: application/json" -H 'X-Auth-Token: u@pf#41[gYHJm<]9N[a0iWDQQ7`e9k' http://localhost:9400/recording/history -d '{"interface":"SIP/az9kf7"}'
Response::
......@@ -231,7 +234,7 @@ This api helps to find call history of a customer thanks to a list of predefined
**Description:**
:URL: ``/history/customer``
:URL: ``/recording/history/customer``
:Method: ``POST``
:Request Body: A json object with filters (optional) named ``filters`` containing the customer to search for and ``size`` to limit the results returned.
:Response: ``total`` the number of call received by this customer, ``list`` the call details reduced to the ``size`` set in query.
......@@ -252,7 +255,7 @@ A filter is composed of a ``field`` as key (basically column name), an ``operato
Query::
curl -XPOST -H "Content-Type: application/json" -H "Accept: application/json" -H 'X-Auth-Token: u@pf#41[gYHJm<]9N[a0iWDQQ7`e9k'
http://localhost:9400/history/customer -d '{"filters": [{"field":"src_num", "operator": "=", "value": "1456"}], "size":2}'
http://localhost:9400/recording/history/customer -d '{"filters": [{"field":"src_num", "operator": "=", "value": "1456"}], "size":2}'
Response::
......@@ -278,7 +281,7 @@ This api retrieves the last agent id who answered a given caller number.
**Description:**
:URL: ``/last_agent``
:URL: ``/recording/last_agent``
:Method: ``GET``
:Url parameters:
:callerNo: The calling number
......@@ -289,7 +292,7 @@ This api retrieves the last agent id who answered a given caller number.
**Example**
Query::
curl -XGET -H "Content-Type: application/json" -H "Accept: application/json" -H 'X-Auth-Token: u@pf#41[gYHJm<]9N[a0iWDQQ7`e9k' 'http://localhost:9400/last_agent?callerNo=1002&since=100'
curl -XGET -H "Content-Type: application/json" -H "Accept: application/json" -H 'X-Auth-Token: u@pf#41[gYHJm<]9N[a0iWDQQ7`e9k' 'http://localhost:9400/recording/last_agent?callerNo=1002&since=100'
Response::
......
......@@ -23,6 +23,11 @@ New Features
Behavior Changes
^^^^^^^^^^^^^^^^
* API
* Recording server API URL was changed. It is now prefixed with *recording*. For example */records/search* URL
was changed to */recording/records/search*.
Upgrade
^^^^^^^
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment