JSON API » numbers » numbers/system/create

Adds one or more new numbers to the system.

Input parameters

Requires authentication and the system role privilege.

NameTypeDescriptionRequiredDefault value
auth_usernameStringAuthentication username.Yes
auth_passwordStringAuthentication password.Yes
startStringThe first number to add.Yes
classIntegerThe number class to put the number(s) in.Yes
ingroupIntegerThe inbound group to put the number(s) in.Yes
aliasStringThe alias for the first number. Subsequent numbers will have aliases in sequence. Normally empty string.NoEmpty string.
charge_customerInteger1 to charge the customer for the numbers, 0 not to.No0
customerIntegerID of the customer to assign the number(s) to. 0 to add them to the pool for any customer to later purchase.No0
endStringThe last number to add. Empty string to just add one number.NoEmpty string.
regionIntegerID of region to add numbers to. 0 for no region.No0
stypeString"number" for a normal number, "callerid" for callerid only.No"number"
validationInteger1 to validate input then return, 0 for full action.No0

Ranges are limited to one million numbers.

Responses

CodeDescription
200Success.
201Input passed validation. Only returned if validation=1.
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.

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

VersionChanges
3.14stype input parameter added.
3.13Function added.