JSON API » numbers » numbers/update
Updates the customer fields of an existing number. If the customer does not yet own the number, it must first be purchased.
Input parameters
Requires authentication and the administrator, user, or wholesale role privileges.
Name | Type | Description | Required | Default value |
---|---|---|---|---|
auth_username | String | Authentication username. | Yes | |
auth_password | String | Authentication password. | Yes | |
number | String | Number to update. | Yes | |
callerid | String | Callerid to pass. Empty string for original, a number, "ask" to ask, "ask_prepend_original" to ask and prepend to original, "ask_append_original" to ask and append to original. | No | Current value. |
customer_callerid | Integer | 1 to allow sub-customers to use as caller, 0 not to. | No | Current value. |
description | String | Description. | No | Current value. |
direct | Integer | 1 to allow callers to enter number in IVRs and attendant, 0 not to. | No | Current value. |
directory | Integer | 1 to mark for inclusion in directory, 0 not to. | No | Current value. |
dtype | String | Destination type. | No | Current value. |
dnumber | String | Destination number. | No | Current value. |
emergency_register | Integer | 1 to mark for registration with emergency service, 0 not to. | No | Current value. |
fax_detect | Integer | 1 to detect faxes, 0 not to. | No | Current value. |
fax_dtype | String | Destination type on fax detection. | No | Current value. |
fax_dnumber | String | Destination number on fax detection. | No | Current value. |
language | String | Language number. Empty string for default. | No | Current value. |
maximum_seconds | Integer | Maximum seconds to let call run for, -1 for no limit. | No | Current value. |
music | Integer | ID of music class to play. 0 for default. | No | Current value. |
owner | Integer | ID of owner. 0 for none. | No | Current value. |
panel | Integer | 1 to display in control panel, 0 not to. | No | Current value. |
password | String | PIN to update number. Empty string to forbid. | No | Current value. |
play_message | Integer | 1 to play message to callers, 2 to play without answering, 0 not to play. | No | Current value. |
recordgroup | Integer | ID of record group. 0 for none. | No | Current value. |
routing | String | Temporary routing. "default" for default only, "timegroup_<ID>" for time group, number, or empty string for normal. | No | Current value. |
screen | Integer | 1 to screen calls and play callerid, 2 to ask callers to record name, 3 to play file, 4 to play file and caller ID, 0 not to screen. | No | Current value. |
sname | String | Force caller name. Empty string for no change. | No | Current value. |
sname_action | String | "replace" to replace caller name, "prepend" to prepend", "append" to append. | No | Current value. |
update_routing | String | 1 to automatically update routing, 0 not to. | No | Current value. |
validation | Integer | 1 to validate input then return, 0 for full action. | No | 0 |
Responses
Code | Description |
---|---|
201 | Input passed validation. Only returned if validation=1. |
204 | Success. |
400 | Invalid input parameters specified. Check the key and message fields for more details. |
401 | The authentication details provided are invalid. |
402 | Your role does not allow this. |
404 | The number does not exist, or you do not have permission to update it. |
Data returned
No data is returned.
Example: Changing the destination
http://enswitch.example.com/api/json/numbers/update/?auth_username=user;auth_password=password;number=2125551234;dtype=phone;dnumber=1234567{ "responses":[ { "code":"204", "key":"", "message":"OK" } ] }
Change history
Version | Changes |
---|---|
3.13 | Function added. |