Eeshita
11/12/2024, 5:13 PMEeshita
11/12/2024, 5:14 PMVapi
11/12/2024, 5:15 PMVapi
11/12/2024, 5:15 PMEeshita
11/12/2024, 5:16 PMVapi
11/12/2024, 5:17 PMVapi
11/12/2024, 5:17 PMEeshita
11/12/2024, 5:17 PMVapi
11/12/2024, 5:17 PMrequests
to interact with APIs. Here's a generic example of how you might fetch call logs using Python:
python
import requests
from datetime import datetime, timedelta
# Replace with your actual API endpoint and access token
api_endpoint = "https://api.yourvapi.com/call-logs"
access_token = "your_access_token"
# Set the desired time frame for the call logs
end_date = datetime.now()
start_date = end_date - timedelta(days=1)
# Format dates in the required format (e.g., ISO 8601)
start_date_str = start_date.isoformat()
end_date_str = end_date.isoformat()
# Prepare the headers and parameters for the API request
headers = {
"Authorization": f"Bearer {access_token}",
"Content-Type": "application/json"
}
params = {
"start_date": start_date_str,
"end_date": end_date_str
}
# Make the API request to fetch the call logs
response = requests.get(api_endpoint, headers=headers, params=params)
# Check if the request was successful
if response.status_code == 200:
call_logs = response.json()
# Process the call logs as needed
print(call_logs)
else:
print(f"Failed to fetch call logs: {response.status_code}")
# Note: This is a generic example and may need to be adjusted based on the actual API.
Please replace the placeholders with your actual API endpoint, access token, and any other necessary parameters. If you need further assistance with the specific API you're using, please let me know, and I'll do my best to help.Eeshita
11/12/2024, 5:20 PMVapi
11/12/2024, 5:20 PM{'message': 'Cannot GET /call-logs', 'error': 'Not Found', 'statusCode': 404}
indicates that the API endpoint for fetching call logs either does not exist at the specified path or there might be a typo in the URL.
Here are a few steps you can take to resolve this issue:
1. **Check the Endpoint URL**: Ensure that the URL you are using matches the one provided in the API documentation. It's possible that the endpoint might have a different path or require a specific base URL.
2. **API Version**: If the API has different versions, make sure you are using the correct version in the URL.
3. **Base URL**: Verify that you have the correct base URL for the API. Sometimes APIs have different base URLs for different environments (e.g., staging vs. production).
4. **Documentation**: Since you mentioned that the documentation is outdated, it's possible that the endpoint has been changed or deprecated. If you can't find updated documentation online, you may need to contact the API provider's support team for the latest information.
5. **API Access**: Confirm that your API access token is valid and that your account has permission to access the call logs endpoint.
If you're still unable to resolve the issue after checking these points, please reach out to the support team for the API you're using. They should be able to provide you with the correct endpoint and updated documentation. If there's anything else I can assist you with, please let me know!Shubham Bajaj
11/13/2024, 9:32 AMEeshita
11/13/2024, 12:28 PMEeshita
11/13/2024, 4:20 PMEeshita
11/13/2024, 4:20 PMEeshita
11/13/2024, 4:27 PMEeshita
11/13/2024, 4:29 PMNoema
11/13/2024, 7:45 PMpython
params = {
"start_date": start_date_str,
"end_date": end_date_str,
"limit": 250
}
response = requests.get(api_endpoint, headers=headers, params=params)
Eeshita
11/14/2024, 5:08 AMShubham Bajaj
11/14/2024, 1:03 PMShubham Bajaj
11/14/2024, 1:04 PMEeshita
11/26/2024, 4:42 PMShubham Bajaj
11/27/2024, 5:51 AMEeshita
12/02/2024, 1:43 PMShubham Bajaj
12/03/2024, 8:08 AMexample
curl -G https://api.vapi.ai/call?createdAtGt=2024-12-03T08%3A06%3A47.856Z&limit=0&createdAtLt=2024-12-03T08%3A08%3A18.007Z&createdAtGe=2024-12-03T08%3A08%3A26.673Z \
-H "Authorization: Bearer " \
--data-urlencode createdAtGt=2024-12-03T08:06:47.856Z \
-d limit=0 \
--data-urlencode createdAtLt=2024-12-03T08:08:18.007Z \
--data-urlencode createdAtGe=2024-12-03T08:08:26.673Z