import requests
url = "http://localhost:3000/v1/call/"
payload = {
"from_number": "<string>",
"to_number": "<string>",
"dynamic_variables": {}
}
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",
"status": "dialing",
"type": "inbound",
"contact": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_date": "2023-11-07T05:31:56Z",
"identifier": "<string>",
"contact_type": "call"
},
"phone_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>"
}Make an outbound call. The call will be initiated by the outbound agent associated with the phone.
import requests
url = "http://localhost:3000/v1/call/"
payload = {
"from_number": "<string>",
"to_number": "<string>",
"dynamic_variables": {}
}
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",
"status": "dialing",
"type": "inbound",
"contact": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_date": "2023-11-07T05:31:56Z",
"identifier": "<string>",
"contact_type": "call"
},
"phone_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
Successful Response
The unique identifier for the call
The unique identifier for the agent 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
Unique identifier for the caller
The date and time when the callerwas registered for the first time. Notice thatthe caller is created just the first time they call.
The identifier of the caller. This is the phone number of the caller if it's a phone call contact or the browser identifier if it's a web contact.
The type of contact.
call, web 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