Retrieving Recording Meta data
Note: The API will only accept POST requests.
The core '4.0 Retrieve Recording' method provides access to the calls audio data. If you want any information about the recording such as when it was made, the duration or the extension that answered the call then you need to retrive the recordings 'meta data' via the 'retrieveMetaData' method.
The retreiveMetaData call also provides information about individual Legs of a recording.
When Noojee Admin records a call it is automatically split into separate recordings referred to a 'Legs'. A call is split each time the call goes through a transition. For example when a call enters a queue a split (Leg) is created, when the call is answered a second Leg is created. If the call is then transferred to a third party the call is once again split. Depending on the calls progress through the system a call could have many legs and 3-5 is typical.
In order to access all of the call recording you need to retrieve each individual leg. In order to identify what legs are available you need to first retrieve the calls meta data via the 'retrieveMetaData' call. From the meta data you can then uniquely identify and retrieve each Leg of the call in turn.
RetrieveMetaData
Before you can retrieve any meta data you must first call the 'authenticate' method to retreive a security hash and timestamp.
The RetrieveMetaData and RetrieveMetaDataByUniqueId commands allows you to retrieve the meta data of a call recording by its 'tag' and 'uniqueId' respectively.
https://<server host>/servicemanager/rest/CallManagementAPI/retrieveMetaData?timeStamp=1447887203341&hash=b48492318f5f18b6d2aa9d7854185c76b61bf8286af4e49c96fbfe660fa2f634&tag=1234 https://<server host>/servicemanager/rest/CallManagementAPI/retrieveMetaDataByUniqueId?timeStamp=1447887370175&hash=377f71544cc7b210bf227ca079410718fda306a32dc5ba392fbf85a629c4ad21&uniqueId=12341232.12
The method returns a json encoded array/map containing any matching calls. There will be an entry in the array for each leg of a call.
[{"Source":"400","Leg":"1","Start":"2014-02-13 17:06:52.0","Tag":"1234","Duration":"4","Username":"Fred","CallRecordId":"198348","UniqueId":"1392271611.238","DID":"internal","Direction":"2","Destination":"410"}]
The following fields are returned:
Source | The phone number that originated the call. For outbound calls this will be the extension no. For inbound calls this is the caller id (if available). |
Leg | The leg no. of the call. The first Leg is leg 1. |
Start | The date/time that the leg started. For the first leg this will usually be an approximation of the start date/time of the actual call. Note: there is often a small delay between the call's actual start date/time and the first legs actual start/date time. If recording is not turned on when the call first starts (but on a later transition) then the can be a significant gap between the legs start and the call startr. |
Tag | The tag attached to the call recording. |
Duration | The duration of the call leg in seconds. |
Username | The username of the user that owns this leg of the call. The owner is normally the agent that took the call. For legs where the call is not currently connected the Username will normally be the 'default' username attached to the route (for inbound calls) which is typically 'Administrator'. |
CallRecordId | The unique id of the legs database record. |
UniqueId | The unique Id of the call this leg is a recording off. |
DID | If the call is an inbound call then this is the DID that the caller dialed. For internal calls this is set to 'internal'. |
Direction | The direction of the call. For inbound calls this is set to 0, for outbound 1 and for Internal calls 2. |
Destination | The phone no. of the end point that took the call. For inbound and internal calls this will normally be the extension that answered the call. For outbound calls this will be the dialed no. |