How to manage batch numbers through API
Overview
This document provides an in-depth explanation of managing batch numbers via an API. It specifically elaborates on the usage and management of phone numbers and phone number set.
Authentication
Navigate to the API Authentication to learn more about Authorization Token Endpoint and Authentication process.
Error Codes
Omilia's HTTP response codes can be found on the HTTP Code Responses page.
API Reference
The following provides a thorough explanation of the batch numbers management API endpoints. All the endpoints are grouped as follows:
{{baseUrl}} depends on the user's environment which could be the following:
EU1 - https://eu1-m.ocp.ai/integrations
US1 - https://us1-m.ocp.ai/integrations
Managing phone numbers
Fetch list of numbers
GET | {{baseUrl}}/api/numbers | Fetches the list of numbers under a group. |
---|
List available for purchase numbers
POST | {{baseUrl}}/api/numbers | Retrieves the list of available for purchase numbers. |
---|
Buy a number
PUT | {{baseUrl}}/api/numbers | Request to buy a phone number from the provider. |
---|
Update group
PUT | {{baseUrl}}/api/numbers/group | Updates a group of telephone numbers. |
---|
Detach a number from a miniApp
PUT | {{baseUrl}}/api/numbers/detach | Detaches a number from a miniApp. |
---|
Operations on numbers using CSV file
PUT | {{baseUrl}}/api/numbers/csv | Executes operations on numbers using a CSV file. |
---|
Fetch numbers as CSV
POST | {{baseUrl}}/api/numbers/csv | Fetches numbers as CSV using advanced search. |
---|
Attach number to an app
PUT | {{baseUrl}}/api/numbers/attach | Attaches a phone number to an app. |
---|
Updates a phone number’s note
PUT | {{baseUrl}}/api/number/note | Updates a note to linked to a phone number. |
---|
Search for numbers
POST | {{baseUrl}}/api/numbers/search | Searches for numbers based on the search parameters. |
---|
Add numbers to the database
POST | {{baseUrl}}/api/numbers/direct | Adds numbers directly to the database. |
---|
Delete a number
DELETE | {{baseUrl}}/api/numbers/delete/{number} | Deletes a number from the database. |
---|
Managing phone numbers sets
Create a set
POST | {{baseUrl}}/api/numbers-set | Creates a set. |
---|
Get set by ID
GET | {{baseUrl}}/api/numbers-set/{setId} | Retrieves set by ID. |
---|
Get phone numbers sets for group
GET | {{baseUrl}}/api/numbers-set/group/{groupId} | Retrieves phone numbers sets for group. |
---|
Update set
PATCH | {{baseUrl}}/api/numbers-set/{setId} | Updates a set. |
---|
Get phone numbers in set
GET | {{baseUrl}}/api/numbers-set/{setId}/numbers | Retrieves phone numbers in set. |
---|
Get phone numbers for the current user
GET | {{baseUrl}}/api/numbers-set | Retrieves phone numbers sets for the current user. |
---|
Get unique app names and tags in the set
GET | {{baseUrl}}/api/numbers-set/{setId}/miniapps-and-tags | Retrieves pairs of application names and application tags from the numbers in the set. |
---|
Add numbers to set
POST | {{baseUrl}}/api/numbers-set/{setId}/numbers | Adds numbers to set. |
---|
Attach numbers in set
PUT | {{baseUrl}}/api/numbers-set/{setId}/attach | Attaches phone numbers in set to miniApp. |
---|
Detach numbers in set
PUT | {{baseUrl}}/api/numbers-set/{setId}/detach | Detaches numbers in set from the miniApp. |
---|
Remove numbers from set
DELETE | {{baseUrl}}/api/numbers-set/{setId}/numbers | Deletes a number from the database. |
---|
Delete purchased numbers in set
DELETE | {{baseUrl}}/api/numbers-set/{setId}/delete | Deletes purchased numbers in set. |
---|
Delete a set
DELETE | {{baseUrl}}/api/numbers-set/{setId} | Deletes a set. |
---|