Hello,
I am using the Metabase API via python and I am trying to pass parameters to a question using tPOST /api/card/:card-id/query/:export-format. I am passing the parameters like this:
The parameters are not taken into account in the query. I used the data from the network tab in the developer tools to get the right serialized JSON for the parameters so that part should be correct. It does work using the curl command.
Hello @flamber
I have tried to use data = "parameters=%5B%7B%22type%22%3A%22date%2Fall-options%22%2C%22value%22%3A%22past6months%22%2C%22target%22%3A%5B%22dimension%22%2C%5B%22template-tag%22%2C%22usage_date_range%22%5D%5D%7D%2C%7B%22type%22%3A%22id%22%2C%22value%22%3A%5B%2289351%22%5D%2C%22target%22%3A%5B%22dimension%22%2C%5B%22template-tag%22%2C%22org_id%22%5D%5D%7D%2C%7B%22type%22%3A%22string%2F%3D%22%2C%22value%22%3A%5B%22top99p%22%5D%2C%22target%22%3A%5B%22dimension%22%2C%5B%22template-tag%22%2C%22aggregation_function%22%5D%5D%7D%5D"
hello, I am running into a similar issue . I followed the adivce and used copy as cURL in browser. It looks like metabase is query the endpoint .../query whereas I am querying ../query/json. It turns out that changing the endpoint solve the problem. The value returned is accurate. But you lose the formatting of the json... Is this a behavior that someone else spotted ? or is it normal ?
@mazzma12 Then you are doing something different. The Metabase UI uses the API, so if you are getting different results, when you're doing something via the API, then you're not doing the same thing as you're trying to do in the GUI. Please read everything here very carefully: API POST /api/card/:card-id/query/:export-format with parameters