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.

NameTypeDescriptionRequiredDefault value
auth_usernameStringAuthentication username.Yes
auth_passwordStringAuthentication password.Yes
numberStringNumber to update.Yes
allow_calleridString"customer" to allow use as callerid by everyone in the customer, "owner" to allow use only by owner, "recursive" to allow use by all customers recursively.NoCurrent value.
calleridStringCallerid 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.NoCurrent value.
descriptionStringDescription.NoCurrent value.
directInteger1 to allow callers to enter number in IVRs and attendant, 0 not to.NoCurrent value.
directoryInteger1 to mark for inclusion in directory, 0 not to.NoCurrent value.
dtypeStringDestination type.NoCurrent value.
dnumberStringDestination number.NoCurrent value.
emergency_registerInteger1 to mark for registration with emergency service, 0 not to.NoCurrent value.
fax_detectInteger1 to detect faxes, 0 not to.NoCurrent value.
fax_dtypeStringDestination type on fax detection.NoCurrent value.
fax_dnumberStringDestination number on fax detection.NoCurrent value.
languageStringLanguage number. Empty string for default.NoCurrent value.
maximum_secondsIntegerMaximum seconds to let call run for, -1 for no limit.NoCurrent value.
musicIntegerID of music class to play. 0 for default.NoCurrent value.
ownerIntegerID of owner. 0 for none.NoCurrent value.
panelInteger1 to display in control panel, 0 not to.NoCurrent value.
passwordStringPIN to update number. Empty string to forbid.NoCurrent value.
play_messageInteger1 to play message to callers, 2 to play without answering, 0 not to play.NoCurrent value.
recordgroupIntegerID of record group. 0 for none.NoCurrent value.
ringtoneStringRing tone to force. "auto-callback", "call-waiting", "delayed", "external", "forward", "hold-recall", "internal", "normal", "priority", "short", "transfer-recall", or empty string for none.NoCurrent value.
routingStringTemporary routing. "default" for default only, "timegroup_<ID>" for time group, number, or empty string for normal.NoCurrent value.
screenInteger1 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.NoCurrent value.
shortcutInteger1 to route calls to the number internally, 0 not to. Only used if numbers_edit_show_shortcut configuration setting is enabled.NoCurrent value.
snameStringForce caller name. Empty string for no change.NoCurrent value.
sname_actionString"replace" to replace caller name, "prepend" to prepend", "append" to append.NoCurrent value.
text_dtypeStringDestination type for text messages.NoCurrent value.
text_dnumberStringDestination number for text messages.NoCurrent value.
update_routingString1 to automatically update routing, 0 not to.NoCurrent value.
validationInteger1 to validate input then return, 0 for full action.No0

Responses

CodeDescription
201Input passed validation. Only returned if validation=1.
204Success.
400Invalid input parameters specified. Check the key and message fields for more details.
401The authentication details provided are invalid.
402Your role does not allow this.
404The 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

VersionChanges
3.15customer_callerid input parameter replaced by allow_callerid. shortcut, text_dtype, and text_dnumber input parameters added.
3.14ringtone input parameter added.
3.13Function added.