-
Notifications
You must be signed in to change notification settings - Fork 0
Publishing
cnrdh edited this page Nov 12, 2012
·
26 revisions
A guide to publishing a dataset into a new API endpoint
Our new API is a intended as a JSONP backend for autocomplete searches of GCMD Concepts (Keywords).
Setup a new API (storage and authorization)
Create data collection
$ ./bin/gcmd_concepts_to_json > ~/.gcmd/concepts/7.0/gcmd-concepts.json # takes a few seconds
(Case you wonder, this binary is bundled into the API bin
folder via the Ruby GCMD library)
Publish collection using the APIs support for multi-document POSTing:
$ curl -nkX POST https://api.example.com/gcmd/concept/.json -d @/home/api/.gcmd/concepts/7.0/gcmd-concepts.json -H "Content-Type: application/json"
POSTed 10292 documents
Warning: All sorts of bad things will happen if you omit the Content-Type: application/json
header.
Enjoy :)
JSON
- https://api.example.com/gcmd/concept/.json?limit=10
- https://api.example.com/gcmd/concept/006b1ea6-222d-4740-b220-03886d49cd81.json
JSONP