Request/Response model
Overview
Use this request to record a phone call, but make sure you have enabled the Call recording function in the Phone Terminal Setup page. Also, you must set the Record triggered option to When * 1 is pressed.
The Service identifies the phone call using the User Id, Extension number, and PhoneCall Id.
If successful, the Service returns the PhoneCall that was updated.
The request is made by an App that is registered to a User account.
To record a phone call in a desired context, issue a HTTP PUT request:
HTTP-Method = "PUT" URI-Fragment = "/uapi/phoneCalls/" User-Id "/" Extension-Number "/" PhoneCall-Id Query-Parameters = null Request-Payload = PhoneCallAction Return-Object = PhoneCall
PUT /uapi/phoneCall/12/0003*210/444444
HTTP/1.1
HOST uapi.voipnow.com
Authentication: Bearer token
Content Type: application/json
{
"action":"StartRecording",
"format":"wav",
"phoneCallViewId":"01"
}
Request
This section describes how to format the request to the service.
URI fragment
The following parameters must be sent in the URI fragment:
Name | Type | Required | Description |
---|---|---|---|
userId | Yes | Id of the User that owns the Extension involved in the call. | |
extension | Yes | Number of the Extension involved in the call. | |
phoneCallId | Yes | Id of a PhoneCall resource that must be updated. |
Request Payload
When recording PhoneCalls, the following restrictions apply to the PhoneCall resource sent in the Request Payload.
Name | Type | Required | Yes |
---|---|---|---|
action | String | Yes | Action must be set to StartRecording. |
format | String | No | The recording format. Can take one of the values wav and wav49. Default: wav. |
phoneCallViewId | String | Yes | The PhoneCallView that is subject to the update. |
Response
Success
If successful, the Service returns the PhoneCall that was updated and the following HTTP statuses:
HTTP Code | Description |
---|---|
200 | The list of phone calls is returned. |
204 | There are no phone calls to be returned. |
Failure
When it fails, the request returns the following error codes:
HTTP Code | Code | Description |
---|---|---|
400 | pc_recformat_invalid | Value supplied in recFormat parameter is missing or invalid. The parameter must be set to one of the following value: wav or wav49. |
400 | pc_phonecall_invalid | Value supplied in phoneCallId from the URI-Fragment is invalid. The parameter must be set to an alpha-numeric value and reference an existing phone call. |
400 | pc_phonecallview_invalid | Value supplied in phoneCallViewId parameter is missing or invalid. The parameter must reference a view of the phone call identfied by the phoneCallId given in the URI-Fragment. |
Response Body
If any 4xx or 5xx status codes is returned, the body contains the error response . When the request is successful and 200 OK is returned, the body contains a JSON representation.
Example
Below you can find an example that will help you understand the request and the response.
This example starts recording the conversation for between 0003*210 and 7778888. The phoneCallViewId is set to 01, identifying the view of 0003*210. The request is made by an App on behalf of a User.
PUT /uapi/phoneCall/12/0003*210/444444 HTTP/1.1 HOST uapi.voipnow.com Authentication: Bearer token Content Type: application/json { "action":"StartRecording", "format":"wav", "phoneCallViewId":"01" }
Assuming that the request has been successful, the Service sends the following answer:
HTTP/1.1 200 OK ... {"id":"b817d2618fe6f1804333", "extension":"0003*210", "ownerId":"3", "ownerName":"Default Organization", "answered":"2012-06-27T16:08:55+03:00", "published":"2012-06-27T16:08:50+02:00", "phoneCallView":[ { "id":"01", "extension":"0003*210", "answered":"2012-06-27T16:08:55+03:00", "status":"5", "callerId":"John Doe <3333>", "source":["7778888"], "destination":["0003*210"], "recording":"2012-06-27T16:18:55+03:00" } ] "link":{"self":"https://x.x.x.x//uapi/phoneCalls/12/0003*210/b817d2618fe6f1804333"} }
Except where otherwise noted, content in this space is licensed under a Creative Commons Attribution 4.0 International.