Request/Response model
Overview
Use this request to hang up an existing phone call.
The Service identifies the phone call using the User Id, Extension number, PhoneCall Id and the phone number the Extension is connected to.
If successful, the Service returns the PhoneCall Id of the call that has just been hung up.
The request is made by an App that is registered to a User account.
To delete a phone call in a desired context, issue a HTTP DELETE request:
HTTP-Method = "DELETE" URI-Fragment = "/uapi/phoneCalls/" User-Id "/" Extension-Number [ "/" PhoneCall-Id ] Query-Parameters = multiple Request-Payload = null Return-Object = Array<PhoneCall>
DELETE /uapi/phoneCalls/@me/0003*210/7d280cc4feae3255a497?phoneNumber=8887777 HTTP/1.1 HOST uapi.voipnow.com Content Type: application/json Authorization: Bearer token
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 an Extension involved in the call. It can take one of the following values: | |
extension | Yes | Number of the Extension involved in the call. | |
phoneCallId | No | Id of a PhoneCall resource that must be updated. |
Query parameters
All requests to hang up phone calls support the Standard-Request-Parameters and the custom fields parameter. All parameters are optional.
Name | Type | Description |
phoneNumber | string | Phone number of one of the parties involved in the phone call. |
When phoneCallId and phoneNumber are supplied and the phoneNumber is not in the PhoneCall resource described by phoneCallId, no PhoneCall is deleted.
Response
Success
If successful, the request returns a PhoneCall Id collection of the PhoneCalls that have just been hung up and the following HTTP statuses:
HTTP Code | Description |
200 | The phone calls are hung up. |
204 | There are no phone calls to be hung up. |
Failure
If failed, the request returns the following error codes:
HTTP Code | Code | Description |
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_phonenumber_invalid | Value supplied in phoneNumber parameter is missing or invalid. The parameter must be set to a value consisting of digits and optional a + character. |
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 to help you understand the request.
In this example, a phone call for the Extension 0003*210 is hung up. The return of the request contains the Object-Id of the PhoneCall that has just been deleted. The request is made by an App on behalf of a User.
DELETE /uapi/phoneCalls/@me/0003*210/7d280cc4feae3255a497?phoneNumber=8887777 HTTP/1.1 HOST uapi.voipnow.com Content Type: application/json Authorization: Bearer token
Assuming that the request has been successful, the Service sends the following answer:
HTTP 1.1 200 OK ... [ {"id":"7d280cc4feae3255a497"} ]
Except where otherwise noted, content in this space is licensed under a Creative Commons Attribution 4.0 International.