JSON API » numbers » numbers/purchase

Purchases a number for a customer. If number vendors and/or number porting are configured, these will be triggered as appropriate. Once purchased, use numbers/update to set the properties.

Input parameters

Requires authentication and the administrator or wholesale role privileges.

NameTypeDescriptionRequiredDefault value
auth_usernameStringAuthentication username.Yes
auth_passwordStringAuthentication password.Yes
numberStringNumber to purchase.Yes
ingroupIntegerID of inbound group to add ported number to. Only used if porting number.Only if porting number.
customerIntegerID of customer.NoCustomer of authentication user.

Responses

CodeDescription
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.
403Your rate plan does not allow this.

Data returned

No data is returned.

Example: With required parameters

http://enswitch.example.com/api/json/numbers/purchase/?auth_username=user;auth_password=password;number=2125551234

{ "responses":[ { "code":"204", "key":"", "message":"OK" } ] }

Change history

VersionChanges
3.14ingroup input parameter added.
3.13Function added.