Step 7: Run Questions

Now that we've assigned datasets to our question, we're ready to execute a question run. To do so, we need to know what runtime and partition parameters the run is expecting as inputs. The following examples show how to get this metadata and then leverage it to run the question.

Important: The API is rate-limited to allow execution of runs with only 20 calls per hour time period.

This example uses the cleanroom-questions endpoint.

For more information, see the following calls:

Get Question Run Metadata

# Get question run metadata

response = cleanroom_api.get_clean_room_question_details("<YOUR cleanroom question id>")

print(json.dumps(response, indent=4))

Get Parameters for the Run

# From the previous JSON response, we can capture parameter names for input into our parameters JSON for the run.

create_run_parameters = {
    "name" : "Test Run - API Tutorial",
    "parameters" : {
       "click_attribution_window" : "7",
       "imp_attribution_window" : "7" 
    }
}

cleanroom_question_id = "<YOUR cleanroom_question_id>"

# Execute run

response = cleanroom_api.create_run(cleanroom_question_id,create_run_parameters)
print(json.dumps(response, indent=4))