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.
Name | Type | Description | Required | Default value |
---|---|---|---|---|
auth_username | String | Authentication username. | Yes | |
auth_password | String | Authentication password. | Yes | |
number | String | Number to purchase. | Yes | |
ingroup | Integer | ID of inbound group to add ported number to. Only used if porting number. | Only if porting number. | |
customer | Integer | ID of customer. | No | Customer of authentication user. |
Responses
Code | Description |
---|---|
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/numbers/purchase/?auth_username=user;auth_password=password;number=2125551234{ "responses":[ { "code":"204", "key":"", "message":"OK" } ] }
Change history
Version | Changes |
---|---|
3.14 | ingroup input parameter added. |
3.13 | Function added. |