JSON API » access » access/create
Creates a new remote access account.
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 | |
name | String | Name. | Yes | |
type | String | "callback", "direct", or "menu". | Yes | |
account | String | Account number to authenticate caller. | No | Empty string. |
callerid | String | Callerid to match. | No | None. |
callerid_external | String | Callerid to transmit on external calls. | No | Empty string. |
callerid_internal | String | Callerid to transmit on internal calls. | No | Empty string. |
cos | Integer | ID of class of service. 0 for none. | No | 0 |
customer | Integer | ID of customer to create in. | No | Customer of authentication user. |
description | String | Description. | No | Empty string. |
dialplan | String | Dial plan. Empty string for default. | No | Empty string. |
dnumber | String | Number to automatically dial. Empty string for none. | No | Empty string. |
dtmf_connect_caller | String | DTMF to play to caller when outbound call connects. | No | Empty string. |
locked | Integer | 1 to lock the account, 0 not to. | No | 0 |
owner | Integer | ID of owning person. 0 for none. | No | 0 |
password | String | PIN to authenticate caller. | No | Empty string. |
play_balance | Integer | 1 to play the balance to caller, 0 not to. | No | 0 |
prefix | String | Called number prefix to match. Empty string for none. | No | Empty string. |
presentation_external | Integer | 1 to allow callerid presentation on external calls, 32 to forbid it. | No | 1 |
recordgroup | Integer | ID of record group. 0 for none. | No | 0 |
source | String | Source IP address to match. Empty string for none. | No | Empty string. |
strip | Integer | Number of digits to strip from called number. Normally only used with prefix. | No | 0 |
validation | Integer | 1 to validate input then return, 0 for full action. | No | 0 |
If the type is "callback", the a callerid must be specified. If the type is "menu", then either an account or a callerid must be specified.
Responses
Code | Description |
---|---|
200 | Success. |
201 | Input passed validation. Only returned if validation=1. |
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
The ID of the created account.
Example: With required parameters
http://enswitch.example.com/api/json/access/create/?auth_username=user;auth_password=password;name=example;type=menu;account=12345{ "responses":[ { "code":"200", "key":"", "message":"OK" } ], "data":{ "id":123 } }
Change history
Version | Changes |
---|---|
3.13 | Function added. |