JSON API » numbers » numbers/system/create
Adds one or more new numbers to the system.
Input parameters
Requires authentication and the system role privilege.
| Name | Type | Description | Required | Default value |
|---|---|---|---|---|
| auth_username | String | Authentication username. | Yes | |
| auth_password | String | Authentication password. | Yes | |
| start | String | The first number to add. | Yes | |
| class | Integer | The number class to put the number(s) in. | Yes | |
| ingroup | Integer | The inbound group to put the number(s) in. | Yes | |
| alias | String | The alias for the first number. Subsequent numbers will have aliases in sequence. Normally empty string. | No | Empty string. |
| charge_customer | Integer | 1 to charge the customer for the numbers, 0 not to. | No | 0 |
| customer | Integer | ID of the customer to assign the number(s) to. 0 to add them to the pool for any customer to later purchase. | No | 0 |
| end | String | The last number to add. Empty string to just add one number. | No | Empty string. |
| region | Integer | ID of region to add numbers to. 0 for no region. | No | 0 |
| stype | String | "number" for a normal number, "callerid" for callerid only. | No | "number" |
| validation | Integer | 1 to validate input then return, 0 for full action. | No | 0 |
Ranges are limited to one million numbers.
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. |
Data returned
How many numbers were added.
Example: Adding a single number
http://enswitch.example.com/api/json/numbers/system/create/?auth_username=user;auth_password=password;start=2125550000;class=1;ingroup=2{ "responses":[ { "code":"200", "key":"", "message":"OK" } ], "data":{ "count":1 } }
Example: Adding a range of numbers
http://enswitch.example.com/api/json/numbers/system/create/?auth_username=user;auth_password=password;start=2125550000;end=2125559999;class=1;ingroup=2{ "responses":[ { "code":"200", "key":"", "message":"OK" } ], "data":{ "count":10000 } }
Change history
| Version | Changes |
|---|---|
| 3.14 | stype input parameter added. |
| 3.13 | Function added. |
