I’m having a problem filtering the json selection to just what I want. The documentation seems to think that it’s possible, but some standard code is not working for me in Python.
if response.status_code == 200:
item_sets = response.json()
#print(f"Response JSON: {item_sets}")
with open('item_sets-raw.json', 'w') as json_file:
json.dump(item_sets, json_file, indent=4)
If you open up item_sets-raw.json, it’s every darn thing in the item set db.
I wish there were a few rock solid examples of the API in action in the documentation. It would be a big help for people who need some hand holding on these things.
In what way are you trying to filter the response? Your “fields” and “select” parameters don’t really match anything the API supports, and I’m not sure what you’re intending to do with them. If you have a reference to documentation that suggests otherwise we can look at clarifying it.
It kind of looks to me like you’re trying to have it include all the sets but only some values for each one? And that just isn’t a mode of operation the API really supports; its query parameters are generally more about selecting which resources to return, but you get all the data for a resource when you do get it.
Ah ok. I thought this kind of limiting of the return/filtering could be done on request. Thanks for clarifying!
In terms of examples, it would be nice, I think, in the documentation, to show, using the REST api, how you can search for a specific string within the title and description of all the items, or how to query the api and return instances of a specific (or multiple) resource classes within the full set of items. Showing an example of how a request would look in Python or even in a URL request would go a long way for people like myself understanding how the API really works in Omeka S.