Depending on the nature of your programmatic workflow, you may wish to poll the API for the status of the run to know when to pull its results and execute additional dependent runs.
Important: Limit polling for status to a maximum of one call per run ID every 5 minutes.
You can find the run ID can be found in the UI in the "View Reports" view of a question run and you can programmatically use the Fetch a list of all Cleanroom Question Runs for a Cleanroom Question call to return a list of question runs.
The following example uses the cleanroom-questions endpoint to get the status of a given run and the run results.
For more information, see the following calls:
- GET /cleanroom-questions/{cleanroomQuestionId}
- GET /cleanroom-question-runs/{cleanroomQuestionRunId}/data
Get the Run Status
# GET run status for a given run
run_id = "<YOUR clean room question run id>"
response = cleanroom_api.get_question_run_status(run_id)
print(json.dumps(response, indent=4))
Return Completed Run Results
# Once status = COMPLETED, pull run results programmatically.
run_id = "<YOUR clean room question run id>"
response = cleanroom_api.get_question_run_data(run_id)
print(json.dumps(response, indent=4))