Can't figure out how to create a report run with parameters through API

I have a report that has a parameter for client_id. I can create a new run with parameters from the web client, but I can't seem to find anywhere in the documentation that describes how to specify report parameters through the api.

Web form works fine when I fill out the form here:<my_account>/reports/<my_report>/

API endpoint used:

POST -><my_account>/reports/<my_report>/runs/

I have tried raw data of `{"parameters": {"client_id":"123"}}`, `{"client_id":"123"}`, `{"params":{"client_id":"123"}}`, etc. but when I query report runs, the parameter always has a value of null, and the ones created with the web form always have the value I entered.

2replies Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
  • Hi Grant Lester - apologies for the delayed response.

    When accessing a Mode report via URL, you can provide values for the report's parameters within the URL itself by adding them to the URL as follows:{{org_username}}/reports/{{report_token}}?param_client_id=123

    Basically, prepend the parameter name that you've defined in your Liquid code with "param_".

    More information can be found in our documentation:

    Hope that helps - please do reach out to our success team via in-product chat or if we can be of further assistance. Thanks!

  • I don't think the answer here answers the question posed. The question posed by OP was specifically referring to the Mode API, and I'm seeing the same thing - I can add GET parameters to the url with the format "?param_<parameter_name>=<value>", and this works when accessing the report via web, but doing that with a POST request to the API to kick off a run of the report always seems to result in a failed run, and the parameters seem to be the problem - they are null in the report run. 


    So to reiterate - how can we pass parameters into a report to kick off a run via API?

Like Follow
  • Status Answered
  • 7 mths agoLast active
  • 2Replies
  • 908Views
  • 3 Following