Assign up to 15 numbers to accounts
const url = 'https://api.siprtc.io/v1/Accounts/AC000000000000000000/PhoneNumbers/BulkBuy';const options = { method: 'POST', headers: {Authorization: 'Basic <credentials>', 'Content-Type': 'application/json'}, body: '{"application_type":"ContactCenter","customers":[{"customer_id":"AC000000000000000001","numbers":["+15555550100","+15555550101"]}],"modified_by":"jane@example.com","route_list":"12","route_tag":"3"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.siprtc.io/v1/Accounts/AC000000000000000000/PhoneNumbers/BulkBuy \ --header 'Authorization: Basic <credentials>' \ --header 'Content-Type: application/json' \ --data '{ "application_type": "ContactCenter", "customers": [ { "customer_id": "AC000000000000000001", "numbers": [ "+15555550100", "+15555550101" ] } ], "modified_by": "jane@example.com", "route_list": "12", "route_tag": "3" }'Vendor accounts only. Assigns numbers from your inventory to your own account or to direct child accounts, each with the same rules as Assign (buy) a phone number; route_list, route_tag and application_type apply to every new subscription. Up to 15 numbers in total. Each number is handled on its own, so the response lists which were assigned and which failed (wrong account, duplicate in the request, not available, document not verified); the call succeeds even when every number fails.
Authorizations
Section titled “ Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ”Your Auth ID.
Example
AC000000000000000000Request Bodyrequired
Section titled “ Request Bodyrequired ”Accounts and the numbers to assign to each
object
Product label such as ContactCenter or FrontDesk, used when an inventory number has none.
Example
ContactCenter1 to 15 entries; at most 15 numbers in total across all entries.
object
Auth ID of the account to assign the numbers to: yours or a direct child’s.
Example
AC0000000000000000011 to 15 numbers from your inventory.
Example
[ "+15555550100", "+15555550101"]Optional name of the person making the change, recorded in the audit log.
Example
jane@example.comID of a SIP route list to attach to every new subscription.
Example
12ID of a SIP route tag to attach to every new subscription.
Example
3Responses
Section titled “ Responses ”Per-number results
object
The numbers not assigned, with reasons.
object
The account it was to be assigned to.
The number as sent.
Why it was not assigned, e.g. “record not found” when it is not available in your inventory.
Number of numbers that could not be assigned.
Summary, e.g. “1 purchased successfully, 1 could not be purchased”.
The numbers assigned.
Number of numbers assigned.
Example
{ "failed": [ { "customer_id": "AC000000000000000001", "phone_number": "+15555550101", "reason": "record not found" } ], "failedCount": 1, "message": "1 purchased successfully, 1 could not be purchased", "purchased": [ "+15555550100" ], "purchasedCount": 1}Body not valid JSON, a validation rule failed, more than 15 numbers, or the gateway could not resolve your company (company id is empty)
object
Human-readable result or error.
Success or failed.
Example
{ "message": "phone number not found", "status": "failed"}Missing or invalid credentials (returned by the API gateway)
Example generated
example