2. JSON - Search Assets

Calling The API

Assets and Asset Media are the main API that most users will need. When you search for assets or upload assets the results will be filtered by the permissions for that user. The MediaDB tool has three parts: 1. Select the section you are interested in such as Asset Search 2. The URL should be of HTTP type POST, UPDATE, DELETE or GET 3. The request should be JSON syntax and the results will normally come back as JSON results or a JSON error message 4. Example curl command to search for assets:

 curl -H "Content-Type: application/json" -X POST http://em9dev.entermediadb.org/openinstitute/mediadb/services/module/asset/search -b 'entermedia.key=adminmd5421c0af185908a6c0c40d50fd5e3f16760d5580bc' -d '{ "page": "1", "hitsperpage": "20", "query": { "terms": [{ "field": "id", "operator": "matches", "value": "*" }] } }'| python -mjson.tool

5. Other way to find an asset by ID:

 curl -X GET -b 'entermedia.key=adminmd5421c0af185908a6c0c40d50fd5e3f16760d5580bc'  'http://em9dev.entermediadb.org/openinstitute/mediadb/services/module/asset/data/AVVKhPmnX6umoHWGYgtH' | python -mjson.tool