Page tree
Skip to end of metadata
Go to start of metadata
This method allows parking a call in particular contexts such as User, Organization or global.

Request/Response model

Overview

Use this request to park a phone call. This action results in a party of the phone call being parked in the system's parking lot.

The Service identifies the phone call using the User Id, the 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 park a phone call, issue a HTTP PUT request:

Model
HTTP-Method        = "PUT"
URI-Fragment = "/uapi/phoneCalls/" User-Id "/" Extension-Number "/" PhoneCall-Id
Query-Parameters = null
Request-Payload = PhoneCallAction
Return-Object      = Array<PhoneCall>
Example
PUT /uapi/phoneCalls/12/0003*210/b817d2618fe6f1804333
HTTP/1.1
HOST uapi.voipnow.com
Content Type: application/json
Authorization: Bearer token

{
  "action":"Park", 
  "maxInParking":"30",
  "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.

NameTypeRequiredDescription

userId

User-Id

Yes

Id of the User that owns the Extension involved in the phone 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

Yes

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

Request Payload

When parking PhoneCalls, the following restrictions apply to the PhoneCall resource sent in the Request Payload.

NameTypeRequiredDescription
actionStringYesAction must be set to Park.
maxInParkingNumberNo

The time interval during which the call stays in the parking lot.
When the time runs out, the phone call is picked up from the parking lot by the Extension that put it there.
Possible values: 10 to 3,600 seconds.
Default values: 180 seconds.

phoneCallViewIdStringYesThe 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 CodeDescription
200The phone call is returned.
204There is no phone call to be returned.

Failure

When it fails, the request returns the following error codes:

HTTP CodeCodeDescription
400pc_parktimeout_invalidValue supplied in maxInParking parameter is missing or invalid. The parameter must be set to a numeric value and represents the number of seconds a call can stay in the parking lot.
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_phonecallview_invalidValue 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.

Examples

Below you can find an example that will help you understand the request and the response.

This example parks the phone call between local number 0003*210 and public number 3235742879. It will send the phone number 3235742879 to the parking lot. The phoneCallViewId is set to 01, identifying the view of 3235742879.

The request is made by an App on behalf of a User.

HTTP Request
PUT /uapi/phoneCalls/12/0003*210/b817d2618fe6f1804333
HTTP/1.1
HOST uapi.voipnow.com
Content Type: application/json
Authorization: Bearer token

{
  "action":"Park", 
  "maxInParking":"30",
  "phoneCallViewId":"01"
}

Assuming that the request has been successful, the Service sends the following answer:

HTTP Response
HTTP/1.1 202 Accepted
...
[
 {
  "id":"b817d2618fe6f1804333",
  "extension":"0003*210",
  "link":{"self":"https://x.x.x.x/uapi/phoneCalls/12/0003*210/b817d2618fe6f1804333"}
 }
]
HTTP Response
HTTP/1.1 200 OK
...
 
{
"entry":[
  {
  "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":["0003*210"],
       "destination":["3235742879"]
       "parked":"2012-06-27T16:18:55+03:00",
       "parkedPos":"3",
	   "parkedBy":"0003*210"
	}
  ],
  "link":{"self":"https://x.x.x.x/uapi/phoneCalls/12/0003*210/b817d2618fe6f1804333"}
 }
],
"startIndex":0,
"totalResults":1,
"itemsPerPage":20,
"filtered":false,
"sorted":false,
"paging":{...}
}
  • No labels

Except where otherwise noted, content in this space is licensed under a Creative Commons Attribution 4.0 International.