import os, requests
def all_calls(**filters):
params = {"limit": 100, **filters}
while True:
page = requests.get("https://api.telleo.ai/v1/calls", params=params,
headers={"X-API-Key": os.environ["TELLEO_API_KEY"]}, timeout=15).json()
yield from page["data"]
if not page["has_more"]:
return
params["starting_after"] = page["data"][-1]["id"]
for call in all_calls(batch_id="batch_2b9e0c1d4f6a8e7c5b3a1d0f"):
print(call["id"], call["status"])