import requests
url = "https://api.diga.io/v1/phone/import"
payload = {
"phone_number": "<string>",
"nickname": "<string>",
"sip_config": {
"termination_uri": "<string>",
"username": "<string>",
"password": "<string>"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"number": "<string>",
"telephony_provider": "netelip",
"status": "reserved",
"nickname": "<string>",
"released_at": "2023-11-07T05:31:56Z",
"assigned_at": "2023-11-07T05:31:56Z",
"inbound_agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"outbound_agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}Import a phone number from an external SIP provider.
This endpoint allows you to use your own phone numbers with custom SIP trunks
import requests
url = "https://api.diga.io/v1/phone/import"
payload = {
"phone_number": "<string>",
"nickname": "<string>",
"sip_config": {
"termination_uri": "<string>",
"username": "<string>",
"password": "<string>"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"number": "<string>",
"telephony_provider": "netelip",
"status": "reserved",
"nickname": "<string>",
"released_at": "2023-11-07T05:31:56Z",
"assigned_at": "2023-11-07T05:31:56Z",
"inbound_agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"outbound_agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
List of phone numbers to be imported
Nickname to assign to the imported phone number
SIP configuration details for the imported phone number. If not provided, the phone number will be available only for inbound calls.
Mostrar atributos secundarios
Successful Response
Unique identifier for the phone register record
The phone number
The telephony provider (NETELIP for purchased numbers, CUSTOM for imported numbers)
netelip, custom Current status of the phone register (RESERVED, ASSIGNED, RELEASED, FINISHED)
reserved, assigned, released, finished The nickname given to the phone number
The date and time when the phone was released
The date and time when the phone was assigned
The unique identifier for the agent that will receive the call when this phone receives an inbound call
The unique identifier for the agent that will make the calls when using this phone to make outbound calls