trill_og.sol
12/26/2024, 9:33 PMFlorian - support @ Retell AI
12/27/2024, 1:01 AMtrill_og.sol
12/27/2024, 2:38 PMFilter criteria: {'start_timestamp': 1734588000000, 'end_timestamp': 1734674399999}
Error fetching calls: Error code: 400 - {'error_message': 'request/body/filter_criteria/start_timestamp must be object, request/body/filter_criteria/end_timestamp must be object'}
Exception type: <class 'retell.BadRequestError'>
No calls found with an email in call_analysis.trill_og.sol
12/27/2024, 2:38 PMpython
def fetch_all_calls_with_filter():
all_calls = []
pagination_key = None # Initialize pagination key
while True:
# Correct filter criteria
filter_criteria = {
"start_timestamp": today_start,
"end_timestamp": today_end,
}
try:
# Print filter criteria for debugging
print(f"Filter criteria: {filter_criteria}")
# Fetch calls with filter and pagination
if pagination_key:
response = client.call.list(
filter_criteria=filter_criteria,
pagination_key=pagination_key
)
else:
response = client.call.list(
filter_criteria=filter_criteria
)
except Exception as e:
print(f"Error fetching calls: {e}")
print(f"Exception type: {type(e)}")
break
# Debug: Print response structure
print(f"Fetched {len(response)} calls.")
if not response:
break # No calls in the response, stop pagination
# Append valid calls to the list
all_calls.extend(response)
# Set pagination_key to the last call ID if available
if len(response) > 0:
pagination_key = response[-1].call_id
else:
break # Exit if no more calls
return all_calls having issue with time formattrill_og.sol
12/27/2024, 2:39 PMpython
# Calculate start and end timestamps for the target day
central_offset = timedelta(hours=-6)
central_time_now = datetime.now() + central_offset
today_start = int(datetime.combine(central_time_now - timedelta(days=8), datetime.min.time()).timestamp() * 1000)
today_end = int(datetime.combine(central_time_now - timedelta(days=8), datetime.max.time()).timestamp() * 1000)
start_datetime = datetime.fromtimestamp(today_start / 1000)
end_datetime = datetime.fromtimestamp(today_end / 1000)
print("Start and End Time Parameters")
print(f"Start timestamp: {start_datetime.strftime('%Y-%m-%d %H:%M')}")
print(f"End timestamp: {end_datetime.strftime('%Y-%m-%d %H:%M')}")`trill_og.sol
12/27/2024, 2:39 PMFlorian - support @ Retell AI
12/27/2024, 9:27 PMtrill_og.sol
12/30/2024, 2:25 PM<class 'int'>
Filter criteria: {'start_timestamp': 1734847200000, 'end_timestamp': 1734933599999}trill_og.sol
12/30/2024, 3:34 PMFilter criteria: {'start_timestamp': 1734847200000, 'end_timestamp': 1734933599999}
Error fetching calls: Error code: 400 - {'error_message': 'request/body/filter_criteria/start_timestamp must be object, request/body/filter_criteria/end_timestamp must be object'}
Exception type: <class 'retell.BadRequestError'> @Florian - support @ Retell AIFlorian - support @ Retell AI
12/31/2024, 5:54 AM