Get Call
Get a Call
The Flyflow API allows you to retrieve the details of a specific call by making a GET request to the /call
endpoint. This endpoint returns the information associated with the specified call ID.
Request
Endpoint
GET /call
Headers
Authorization
: The API key prefixed withBearer
. Example:Bearer your_api_key
.
Query Parameters
id
(string, required): The unique identifier of the call you want to retrieve.
cURL Example
curl -X GET \
-H "Authorization: Bearer your_api_key" \
"https://api.flyflow.dev/v1/call?id=call_id"
Replace call_id
with the actual ID of the call you want to retrieve.
Python Client Example
from flyflowclient import Flyflow
client = Flyflow(api_key='your_api_key')
call_id = 'call_id'
call = client.get_call(call_id=call_id)
print(call)
Replace call_id
with the actual ID of the call you want to retrieve.
Response
Status Codes
200 OK
: The call details were successfully retrieved.400 Bad Request
: The request is missing the requiredid
query parameter.401 Unauthorized
: The API key is missing or invalid.404 Not Found
: The specified call ID does not exist.500 Internal Server Error
: An unexpected error occurred on the server side.
Response Body
If the call details are successfully retrieved, the response body will be a JSON object containing the information associated with the call:
{
"id": "call_id",
"agent_id": "agent_id",
"from": "+1234567890",
"to": "+9876543210",
"context": "Hello, this is an important call.",
"status": "completed",
"created_at": "timestamp",
"ended_at": "timestamp",
"duration": 120,
"transcript": [
{
"speaker": "agent",
"text": "Hello, how can I assist you today?"
},
{
"speaker": "customer",
"text": "I have a question about my account."
},
...
]
}
id
(string): The unique identifier of the call.agent_id
(string): The identifier of the agent associated with the call.from
(string): The phone number of the agent who initiated the call.to
(string): The recipient phone number.context
(string): The initial context or message provided for the call.status
(string): The current status of the call (e.g.,"completed"
,"in_progress"
,"failed"
).created_at
(string): The timestamp indicating when the call was created.ended_at
(string): The timestamp indicating when the call ended (if applicable).duration
(number): The duration of the call in seconds (if applicable).transcript
(array): An array of objects representing the transcript of the call, including the speaker and the text of each message.
Error Handling
If an error occurs while retrieving the call details, the API will return an appropriate error response with a corresponding status code and error message in the response body.
For example, if the specified call ID does not exist:
{
"error": "Not Found",
"message": "Call not found"
}
Make sure to handle errors appropriately in your application and provide the correct call ID in the request.
Conclusion
Retrieving the details of a specific call using the Flyflow API is simple. By making a GET request to the /call
endpoint with the required id
query parameter, you can fetch the information associated with the specified call. The API will return a JSON object containing the call details, including the transcript, upon success. Remember to handle errors and provide the necessary authentication and call ID to ensure a smooth integration with the Flyflow platform.
Updated 6 months ago