JSON API » codes » codes/create
Creates a new feature code.
Input parameters
Requires authentication and the administrator or wholesale role privileges.
Name | Type | Description | Required | Default value |
---|---|---|---|---|
auth_username | String | Authentication username. | Yes | |
auth_password | String | Authentication password. | Yes | |
code | String | Feature code to create. | Yes | |
dtype | String | Destination type. | Yes | |
dnumber | String | Destination number. | Yes | |
customer | Integer | ID of customer to create in. | No | Customer of authentication user. |
description | String | Description. | No | Empty string. |
direct | Integer | 1 to allow callers to enter feature code in IVRs and attendant, 0 not to. | No | 0 |
fax_detect | Integer | 1 to detect faxes, 0 not to. | No | 0 |
fax_dtype | String | Destination type on fax detection. | No | Empty string. |
fax_dnumber | String | Destination number on fax detection. | No | Empty string. |
language | String | Language code. Empty string for default. | No | Empty string. |
maximum_seconds | Integer | Maximum seconds to let call run for, -1 for no limit. | No | -1 |
music | Integer | ID of music class to play. 0 for default. | No | 0 |
owner | Integer | ID of owner. 0 for none. | No | 0 |
panel | Integer | 1 to display in control panel, 0 not to. | No | 0 |
password | String | PIN to update feature code. Empty string to forbid. | No | Empty string. |
play_message | Integer | 1 to play message to callers, 2 to play without answering, 0 not to play. | No | 0 |
recordgroup | Integer | ID of record group. 0 for none. | No | 0 |
ringtone | String | Ring tone to force. "auto-callback", "call-waiting", "delayed", "external", "forward", "hold-recall", "internal", "normal", "priority", "short", "transfer-recall", or empty string for none. | No | Empty string. |
routing | String | Temporary routing. "default" for default only, "timegroup_<ID>" for time group, number, or empty string for normal. | No | Empty string. |
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 | 0 |
shared | Integer | 1 to share with all customers on system, 0 not to. | No | 0 |
sname | String | Force caller name. Empty string for no change. | No | Empty string. |
sname_action | String | "replace" to replace caller name, "prepend" to prepend", "append" to append. | No | "replace" |
text_dtype | String | Destination type for text messages. | No | "none" |
text_dnumber | String | Destination number for text messages. | No | Empty string. |
update_routing | Integer | 1 to automatically update routing, 0 not to. | No | 0 |
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. |
403 | Your rate plan does not allow this. |
Data returned
No data is returned.
Example: With required parameters
http://enswitch.example.com/api/json/codes/create/?auth_username=user;auth_password=password;code=100;dtype=phone;dnumber=1234567{ "responses":[ { "code":"204", "key":"", "message":"OK" } ] }
Change history
Version | Changes |
---|---|
4.1 | update_routing input parameter added. |
3.15 | text_dtype and text_dnumber input parameters added. |
3.14 | ringtone input parameter added. |
3.13 | Function added. |