Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Updated using 4PSA automated script
Excerpt

This method allows hanging up PhoneCalls in particular contexts such as User, Organization or global

Table of Contents
maxLevel3
excludeApps Using This, Quick Examples, Need Help?

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:

Panel
borderColor#DADADA
bgColor#FFFFFF
titleBGColor#F0F0F0
borderWidth1
titleModel
borderStyledashedtitleModel
HTTP-Method       = "DELETE"
URI-Fragment      = "/uapi/phoneCalls/" User-Id "/" Extension-Number [ "/" PhoneCall-Id ]
Query-Parameters  = multiple
Request-Payload   = null

Return-Object     = Array<PhoneCall>
Panel
borderColor#DADADA
bgColor#FFFFFF
titleBGColor#F0F0F0
borderWidth1
titleExample
borderStyledashedtitleExample
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

Anchor
urifragment
urifragment

The following parameters must be sent in the URI fragment:

NameTypeRequiredDescription

userId

User-Id

Yes

Id of the User that owns the an Extension involved in the call. It can take one of the following values:
@me - refers to the authenticated User .
@viewer - also refers to the authenticated User .
@owner - refers to the User that owns the Extension used to make the phone call.
User-Id - refers to the unique identifier of the User.
Default: @me

extension

UAPI-Extension-Number

Yes

Number of the Extension involved in the call.
Use @self to match all the extensions under the User.

phoneCallId

Object-Id

No

Id of a PhoneCall resource that must be updated.
If not provided, all phone calls owned by Extension are deleted.
If the Extension is unknown, you can use @self and phoneCallId to identify the phone call.
The PhoneCallId can be retrieved using the List PhoneCalls request.

Query parameters

Anchor
phcall-list-query
phcall-list-query

All requests to hang up phone calls support the Standard-Request-Parameters and the custom fields parameter. All parameters are optional.

NameTypeDescription

phoneNumber

string

Phone number of one of the parties involved in the phone call.
When given, the number involved in the phone call and the Extension are closed.

Note

When phoneCallId and phoneNumber are supplied and the phoneNumber is not in the PhoneCall resource described by phoneCallId, no PhoneCall is deleted.

Response

Success

HTTP CodeDescription
200The phone calls are hung up.
204There are no phone calls to be hung up.

Failure

If failed, the request returns the following error codes:

HTTP CodeCodeDescription
400pc_phonecall_invalidValue 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.
400pc_phonenumber_invalidValue 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.

Anchor
phcallex1
phcallex1

Code Block
titleHTTP Request
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:

Code Block
titleHTTP Response
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.