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:
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
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:
Name | Type | Required | Description |
---|---|---|---|
userId | Yes | Id of the User which owns the Extension for which the event is added. | |
extension | UAPI-Extension-Number | Yes | Number of the Extension for which the event is added. Allowed Extension types: Phone Terminal , Queue , Conference , and IVR . Cannot be set to @self. |
eventType | Number | Yes | The type of the PhoneCallEvent. |
eventId | Object-Id | Yes | The 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 Code | Description |
---|---|
200 | The Id of the newly created phone call event is returned. |
204 | There is no Id to be returned. |
Failure
When it fails, the request returns the following error codes:
HTTP Code | Code | Description |
---|---|---|
400 | pce_type_invalid | Value 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. |
400 | pce_id_invalid | Value supplied in id parameter is invalid. The parameter must be set to an alpha-numeric 32 characters long. |
400 | pce_method_invalid | Value 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. |
400 | pce_note_invalid | Value supplied in note parameter is missing or invalid. It must be string and 1024 characters long. |
400 | pce_url_invalid | Value supplied in request URL parameter is missing or invalid. It must be a valid HTTP URL. |
400 | pce_status_invalid | Value 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. |
400 | extension_invalid | Value 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. |
400 | pce_access_denied | You 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.
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/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"} }
Except where otherwise noted, content in this space is licensed under a Creative Commons Attribution 4.0 International.