import requests
url = "https://api.diga.io/v1/call/"
payload = {
"from_number": "<string>",
"to_number": "<string>",
"dynamic_variables": {},
"agent_version_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
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",
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agent_version_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "dialing",
"type": "inbound",
"contact": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_date": "2023-11-07T05:31:56Z",
"identifier": "<string>",
"contact_type": "call"
},
"phone_register_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_date": "2023-11-07T05:31:56Z",
"recording_url": "<string>",
"start_time": "2023-11-07T05:31:56Z",
"end_time": "2023-11-07T05:31:56Z",
"duration": 123,
"end_reason": "<string>"
}Initiate an outbound call using the outbound agent associated with the specified phone number. Only Spanish phone numbers are supported.
import requests
url = "https://api.diga.io/v1/call/"
payload = {
"from_number": "<string>",
"to_number": "<string>",
"dynamic_variables": {},
"agent_version_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
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",
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agent_version_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "dialing",
"type": "inbound",
"contact": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_date": "2023-11-07T05:31:56Z",
"identifier": "<string>",
"contact_type": "call"
},
"phone_register_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_date": "2023-11-07T05:31:56Z",
"recording_url": "<string>",
"start_time": "2023-11-07T05:31:56Z",
"end_time": "2023-11-07T05:31:56Z",
"duration": 123,
"end_reason": "<string>"
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
The phone number of the caller. You can use one of your phone numbers in E.164 format or the unique identifier of the phone number.
The phone number of the called party in E.164 format.
A dictionary of dynamic variables to be substitute the variables in the prompt
The unique identifier of the agent version to handle the call.
Successful Response
The unique identifier for the call
The unique identifier for the agent that handled the call
The unique identifier for the agent version that handled the call
The current status of the call
dialing, in_progress, completed, failed, transferred, no_answer The direction of the phone call
inbound, outbound Details of the contact that initiated or received the call
Mostrar atributos secundarios
The ID of the phone that was used to make or receive the call
The date and time when the call was created
The call recording URL.
The start time of the call
The end time of the call, if ended
The call duration in seconds. null if the call has not ended
The reason for call termination, if the call has ended