Jeremy Hetzel
06/07/2024, 2:37 PMimport httpx
import json
api_key = ""
account_id = ""
workspace_id = ""
headers = {
"Authorization": f"Bearer {api_key}",
"Content-Type": "application/json",
}
url = f"<https://api.prefect.cloud/api/accounts/{account_id}/workspaces/{workspace_id}/flow_runs/history>"
body = {
"history_start": "2024-06-01T00:00:00Z",
"history_end": "2024-06-02T00:00:00Z",
"history_interval_seconds": 60,
}
with httpx.Client(timeout=10, headers=headers) as client:
response = <http://client.post|client.post>(url, data=json.dumps(body))
response
# <Response [503 Service Unavailable]>
Adding, for example, a deployment filter returns an expected 200. Also, changing the history_interval_seconds to 3600*24 returns an expected 200.
Perhaps it is the appropriate response, just caught me off guard this morning.Serina
06/07/2024, 7:35 PM