mcaplan
mcaplan

Reputation: 77

Superset API Request Filters

I'm attempting to retreive a list of dashboards via the superset API which have a specific owner. I've attempted many unsuccessful ways to compose the request:

/api/v1/dashboard/?q={
  "filters": [
    {
      "col": "owners__username",
      "opr": "eq",
      "value": "bi"
    }
  ]
}

Resulted in Filter column: owners__username not allowed to filter

/api/v1/dashboard/?q={
  "filters": [
    {
      "col": "owners",
      "opr": "any",
      "value": {
          "col": "username",
          "opr": "eq",
          "value": "bi"
      }
    }
  ]
}

Result: Not a valid rison schema

/api/v1/dashboard/?q={
  "filters": [
    {
      "col": "owners",
      "opr": "any",
      "value": "ADMIN0"
    }
  ]
}

Which gives me all results

What am I missing?

Upvotes: 2

Views: 3426

Answers (1)

dpgaspar
dpgaspar

Reputation: 1273

Try this:

/api/v1/dashboard/?q=(filters:!((col:owners,opr:rel_m_m,value:4)))

So that filter only accepts user id's

You can get a list of supported filters on each resource by:

/api/v1/dashboard/_info?q=(keys:!(filters))

Upvotes: 5

Related Questions