If I use a normal text parameter it works like a charm http://some.redash.url/api/queries/query_id/refresh?p_hello=world
But if I try the new date range parameters it returns nothing http://some.redash.url/api/queries/query_id/refresh?p_Rango.start=2018-12-01&p_Rango.end=2019-01-01
How will the call be with the range parameter then? Like this? http://some.redash.url/api/queries/query_id/refresh?p_Rango.start=2018-12-01&p_Rango.end=2019-01-01
The /api/queries/:query_id/refresh endpoint will soon be deprecated. A newer API is available, which offers better security and could be shared easily. You can use this API by submitting a POST to /api/queries/:query_id/results. Query parameters should be passed as “parameters” in the request body.
Thanks rauchy! is there any documentation for this new API?
If the /refresh endpoint won’t be a thing anymore, will there be a way to query for fresh results instead of the cached ones?
Hey @wonderful60, try changing "login_time" in your request body to "p_login_time". Then nest it in a larger object called parameters.
{
"parameters": {
"p_login_time": { ... }
}
This line in the Redash source suggests that your parameter name should have p_ prepended. You can see the same thing in the gist linked above on line 40.
Now, my question is which start and end should I write if I would like to refresh the query with a predefined range like d_last_30_days or d_last_60_days? Any suggestion?
The dynamic date ranges don’t work with the API because they are calculated by the javascript front-end. The redash-toolbelt library includes date_ranges.py which has equivalent calculations you can use:
here’s a simple example repl.it so you can see it in action [LINK]
1 Like
Login or sign up disabled while the site is in read only mode