Number
Overview
The VoIPBIN Number resource represents a VoIPBIN number that is either provisioned directly from VoIPBIN, ported from another service provider, or hosted on VoIPBIN. These numbers are essential for establishing communication channels and enable users to make and receive calls or messages through the VoIPBIN platform.
The Numbers list resource serves as a repository for all VoIPBIN numbers associated with an account. Users can use the POST method on the list resource to provision a new VoIPBIN number. To find an available number for provisioning, users can utilize the subresources of the AvailableNumbers resource, which provides a list of numbers that can be selected for use.
Provisioning a VoIPBIN number is a two-step process. First, users need to find an available number from the list of options provided by the AvailableNumbers resource. Once a suitable number is identified, users must then proceed to the Numbers list resource and use the POST method to provision the selected number.
Flow execution
VoIPBIN’s Number resource offers the capability to associate multiple flows with a single number. This functionality enables users to execute different registered flows based on specific situations or criteria. Currently, the platform supports call_flow_id and message_flow_id, which allows users to define custom flows for handling incoming calls and messages, respectively.
When a call or message is received on a VoIPBIN number, the platform examines the associated flows to determine the appropriate actions to be taken. Depending on the flow’s configuration and the specific situation, different actions may be triggered, such as playing a greeting message, redirecting the call, responding with an automated message, or routing the message to a specific destination.
By allowing multiple flows per number, VoIPBIN empowers users to create dynamic and customized call handling processes. This feature is particularly valuable for businesses or applications that require different call handling behaviors based on the caller’s identity, time of day, or other contextual factors.
VoIPBIN’s Number resource with its flow execution capabilities offers a versatile and powerful toolset for building sophisticated communication applications. It ensures efficient call and message routing, seamless flow execution, and the ability to tailor communication experiences according to specific business needs or user requirements.
Number
Number
{
"id": "<string>",
"number": "<string>",
"call_flow_id": "<string>",
"message_flow_id": "<string>",
"name": "<string>",
"detail": "<string>",
"status": "<string>",
"t38_enabled": <boolean>,
"emergency_enabled": <boolean>,
"tm_create": "<string>",
"tm_update": "<string>",
"tm_delete": "<string>"
}
id: Number’s ID.
number: Number.
call_flow_id: Flow id for incoming call.
message_flow_id: Flow id for incoming message.
name: Number’s name.
detail: Number’s detail description.
status: Number’s status. See detail here
t38_enabled: T38 support.
emergency_enabled: Emergency call support.
example
{
"id": "0b266038-844b-11ec-97d8-63ba531361ce",
"number": "+821100000001",
"call_flow_id": "d157ce07-0360-4cad-9007-c8ab89fccf9c",
"message_flow_id": "00000000-0000-0000-0000-000000000000",
"name": "test talk",
"detail": "simple number for talk flow",
"status": "active",
"t38_enabled": false,
"emergency_enabled": false,
"tm_create": "2022-02-01 00:00:00.000000",
"tm_update": "2022-03-20 19:37:53.135685",
"tm_delete": "9999-01-01 00:00:00.000000"
}
Status
Type |
Description |
---|---|
active |
Number is being used. |
deleted |
Number has deleted. |
Tutorial
Get list of available-numbers
Example
$ curl -k --location --request GET 'https://api.voipbin.net/v1.0/available_numbers?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2MTUwNTQxMjYsInVzZXIiOnsiaWQiOjEsInBlcm1pc3Npb24iOjEsInVzZXJuYW1lIjoiYWRtaW4ifX0.uV26jlo9kdV-qxxj32cjNa99JRcD96HkFF0h_cuEXLA&country_code=US&page_size=5'
{
"result": [
{
"number": "+12182558711",
"country": "US",
"region": "MN",
"postal_code": "",
"features": [
"emergency",
"fax",
"voice",
"sms",
"mms"
]
},
...
]
Get list of numbers
Example
$ curl -k --location --request GET 'https://api.voipbin.net/v1.0/numbers?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2MTUwNTQxMjYsInVzZXIiOnsiaWQiOjEsInBlcm1pc3Npb24iOjEsInVzZXJuYW1lIjoiYWRtaW4ifX0.uV26jlo9kdV-qxxj32cjNa99JRcD96HkFF0h_cuEXLA&page_size=10'
{
"result": [
{
"id": "b7ee1086-fcbc-4f6f-96e5-7f9271e25279",
"number": "+16062067563",
"flow_id": "00000000-0000-0000-0000-000000000000",
"status": "purchase-pending",
"t38_enabled": true,
"emergency_enabled": false,
"tm_purchase": "2021-03-03 06:34:09.000000",
"tm_create": "2021-03-03 06:34:09.733751",
"tm_update": "",
"tm_delete": ""
},
{
"id": "d5532488-0b2d-11eb-b18c-172ab8f2d3d8",
"number": "+16195734778",
"flow_id": "decc2634-0b2a-11eb-b38d-87a8f1051188",
"status": "active",
"t38_enabled": false,
"emergency_enabled": false,
"tm_purchase": "",
"tm_create": "2020-10-11 01:00:00.000001",
"tm_update": "",
"tm_delete": ""
}
],
"next_page_token": "2020-10-11 01:00:00.000001"
}
Get detail of number
Example
$ curl -k --location --request GET 'https://api.voipbin.net/v1.0/numbers/d5532488-0b2d-11eb-b18c-172ab8f2d3d8?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2MTUwNTQxMjYsInVzZXIiOnsiaWQiOjEsInBlcm1pc3Npb24iOjEsInVzZXJuYW1lIjoiYWRtaW4ifX0.uV26jlo9kdV-qxxj32cjNa99JRcD96HkFF0h_cuEXLA'
{
"id": "d5532488-0b2d-11eb-b18c-172ab8f2d3d8",
"number": "+16195734778",
"flow_id": "decc2634-0b2a-11eb-b38d-87a8f1051188",
"status": "active",
"t38_enabled": false,
"emergency_enabled": false,
"tm_purchase": "",
"tm_create": "2020-10-11 01:00:00.000001",
"tm_update": "",
"tm_delete": ""
}
Delete number
Example
$ curl -k --location --request DELETE 'https://api.voipbin.net/v1.0/numbers/b7ee1086-fcbc-4f6f-96e5-7f9271e25279?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2MTUwNTQxMjYsInVzZXIiOnsiaWQiOjEsInBlcm1pc3Npb24iOjEsInVzZXJuYW1lIjoiYWRtaW4ifX0.uV26jlo9kdV-qxxj32cjNa99JRcD96HkFF0h_cuEXLA'
{
"id": "b7ee1086-fcbc-4f6f-96e5-7f9271e25279",
"number": "+16062067563",
"flow_id": "00000000-0000-0000-0000-000000000000",
"status": "deleted",
"t38_enabled": true,
"emergency_enabled": false,
"tm_purchase": "2021-03-03 06:34:09.000000",
"tm_create": "2021-03-03 06:34:09.733751",
"tm_update": "2021-03-03 06:52:53.848439",
"tm_delete": "2021-03-03 06:52:53.848439"
}
Create number
Example
$ curl -k --location --request POST 'https://api.voipbin.net/v1.0/numbers?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2MTUwNTQxMjYsInVzZXIiOnsiaWQiOjEsInBlcm1pc3Npb24iOjEsInVzZXJuYW1lIjoiYWRtaW4ifX0.uV26jlo9kdV-qxxj32cjNa99JRcD96HkFF0h_cuEXLA' \
--header 'Content-Type: application/json' \
--data-raw '{
"number": "+16062067563"
}'
{
"id": "b7ee1086-fcbc-4f6f-96e5-7f9271e25279",
"number": "+16062067563",
"flow_id": "00000000-0000-0000-0000-000000000000",
"status": "active",
"t38_enabled": true,
"emergency_enabled": false,
"tm_purchase": "2021-03-03 18:41:23.000000",
"tm_create": "2021-03-03 18:41:24.657788",
"tm_update": "",
"tm_delete": ""
}