Page tree

This method allows updating existing phone call events in particular contexts such as User, Organization or global.

Request/Response model

Overview

Use this request to update a phone call event assigned to an Extension.

If successful, the Service returns the Id of the newly created PhoneCallEvent, which is later used to query the status of the phone call event.

The request is made by an App that is registered to an User account.

To update existing phone call events, issue a HTTP PUT request:

Model
HTTP-Method       = "PUT"
URI-Fragment      = "/uapi/extensions/" User-Id "/" Extension-Number "/phoneCallEvents/" Event-Type "/" Event-Id
Query-Parameters  = null 
Request-Payload   = PhoneCallEvent

Return-Object     = PhoneCallEvent
Example
PUT /uapi/extensions/@me/0003*210/phoneCallEvents/0/MyPhoneCallEvent HTTP/1.1
HOST uapi.voipnow.com
Content Type: application/json
Authorization: Bearer token

{
  "method": "1",
  "note": "I want to use POST for my event"
}


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 which owns the Extension for which the event is added.
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 YesNumber of the Extension for which the event is added.
Allowed Extension types: Phone Terminal, Queue, Conference, and IVR.
Cannot be set to @self.
eventTypeNumberYesThe type of the PhoneCallEvent.
eventIdObject-IdYesThe Id of an existing PhoneCallEvent.

Response

Success

If successful, the Service returns the Id of the newly created PhoneCallEvent and the following HTTP statuses:

HTTP CodeDescription
200The Id of the newly created phone call event is returned.
204There is no Id to be returned.

Failure

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

HTTP CodeCodeDescription
400pce_type_invalidValue supplied in type parameter is missing or invalid. The parameter must be set to one of the following value: 0 for DialIn, 1 for DialOut and 2 for Hangup.
400pce_id_invalidValue supplied in id parameter is invalid. The parameter must be set to an alpha-numeric 32 characters long.
400pce_method_invalidValue supplied in method parameter is missing or invalid. The parameter must be set to one of the following value: 0 for GET or 1 for POST.
400pce_note_invalidValue supplied in note parameter is missing or invalid. It must be string and 1024 characters long.
400pce_url_invalidValue supplied in request URL parameter is missing or invalid. It must be a valid HTTP URL.
400pce_status_invalidValue supplied in status parameter is missing or invalid. The parameter must be set to one of the following value: 0 for enabled or 1 for disabled.
400extension_invalidValue supplied in the URI-Fragment as extension is invalid. The parameter must reference the number of an existing extension or cannot be set to @self.
400pce_access_deniedYou are not allowed to manage the phone call events.

Examples

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

The example below updates the HTTP method of a event associated with the Extension 0003*210. The request is made by an App on behalf of a User.

HTTP Request
PUT /uapi/extensions/@me/0003*210/phoneCallEvents/0/NqeyDRqo4FtabmFj8gNWq3hsiGNYyqHTTP/1.1
HOST uapi.voipnow.com
Content Type: application/json
Authorization: Bearer token

{
  "method": "1",
  "note": "I want to use POST for my event"
}

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

HTTP Response
HTTP/1.1 200 OK
...
 
{
  "type": "0",
  "id": "NqeyDRqo4FtabmFj8gNWq3hsiGNYyq",
  "method": "1",
  "note": "I want to use POST for my event",
  "url": "http://myevent.com/SaveMyPhoneCallDetails",
  "status": "1",
  "modified":"2012-07-10T18:16:12+03:00",
  "links": {"self":"https://x.x.x.x/uapi/extensions/@me/0003*210/phoneCallEvents/MyPhoneCallEvent"}
 }
#trackbackRdf ($trackbackUtils.getContentIdentifier($page) $page.title $trackbackUtils.getPingUrl($page))
  • No labels

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