2

I'm querying this dataset using ckan 2.0 api

http://data.buenosaires.gob.ar/api/3/action/datastore_search?resource_id=4dcec0c7-7cee-4ff6-ac83-7d92b39b3f69

Everything works fine, it returns me all the records in the dataset

Now I'm trying to add a filters condition, like this

http://data.buenosaires.gob.ar/api/3/action/datastore_search?resource_id=4dcec0c7-7cee-4ff6-ac83-7d92b39b3f69&filters={"ubicacion": "Puerto Madero"}

but it gives me the following error:

[...]
  "success": false,
  "error": {
    "__type": "Validation Error",
    "filters": [
    "Not a json object"
  ]
}

I also tried encoding the value, but I get the same error

The strange thing is that I couldn't find a working example using filters (which makes me really doubt if there's anybody out there really using the API)

Anybod out there can provide me a working example?

opensas
  • 60,462
  • 79
  • 252
  • 386
  • Have you checked if the URL you are invoking needs to be url_encoded first? To my knowledge, [curley brackets are not within the allowed characters for URLs](http://stackoverflow.com/questions/1856785/characters-allowed-in-a-url) – Roman Vottner Feb 22 '16 at 14:54

2 Answers2

1

Looks like a bug: https://github.com/okfn/ckan/pull/917

Got it answered at ask.schoolofdata.org

opensas
  • 60,462
  • 79
  • 252
  • 386
1

Verified att this works on ckan version 2.6

http://host-name/api/action/datastore_search?resource_id=26642b35-c6de-4520-a84c-df313a0a14f4&filters={"key":"value"}

AMKhan
  • 131
  • 1
  • 4