mondras
06/07/2024, 4:22 PMNate
06/07/2024, 6:59 PMmondras
06/17/2024, 11:09 PMjson_data: dict[str, Union[str, int, dict, bool]] = {
"offset": 0,
"limit": 200,
"sort": "ID_DESC",
}
if flow_id != "":
json_data["flow_runs"] = {"operator": "and_", "flow_id": {"any_": [flow_id]}}
all_responses = []
while True:
response = <http://requests.post|requests.post>(final_url, headers=headers, json=json_data)
if not response.ok:
response.raise_for_status()
all_responses.append(response.json())
if len(response.json()) < 200:
break
json_data["offset"] += 200 # type: ignore
it happens quite a bit (at least once a week)