Refresh results with parameter via API


#1

Hi all,

I’m able to get refresh query results by following this example on Github.

I’m, however, experiencing some difficulties in getting fresh results with an added parameter. The results of the POST request with one parameter always lead to this error:

{
    "job": {
        "status": 4,
        "error": "Missing parameter value for: action"
    }
}

Since the problem occurs only, when I try to refresh results with one parameter, my suspicion is that I’m passing the parameter to the POST request in the wrong format. In Postman, I’m adding the parameter to the body of the request in the following format:

{"p_action": "%example.org%"}

Any help or hints to get me on the right track would be really appreciated. If I can provide more details, I’d be happy to do so.

Thank you in advance!


#2

okay, i’ve fixed the problem.

i could get fresh results by passing the parameter in the url of the POST request rather than in the body (as i usually do).

a bit counterintuitive for me, as I’m used to passing parameters in the body of the request, this seems to do the trick:

https://query.redash_url.com/api/queries/query_id/refresh?p_action=%example.org

:grinning:


#3

Glad you figured it out :+1: