API Response Formats
The default API response format is json.
dson
DSON (Doge Serialized Object Notation) is a data-interchange format that is easy to read and write for Shiba Inu dogs. For more details, consult https://dogeon.org/. As of this writing our DSON serialization is not as pretty as some but we hope to remedy that soon.
Example request
curl -X GET 'https://api.www-4.collection.cooperhewitt.org/rest/?method=cooperhewitt.labs.whatWouldMicahSay&access_token=****&format=dson'
Example response
such "micah" is such "says" is "Now I'm just like: Wow, we have a lot to do!" wow ? "stat" is "ok" wow
json
This is the default response format.
JSON (JavaScript Object Notation) is a data-interchange format based on JavaScript. For more details, consult https://json.org/.
Example request
curl -X GET 'https://api.www-4.collection.cooperhewitt.org/rest/?method=cooperhewitt.labs.whatWouldMicahSay&access_token=****&format=json'
Example response
{"micah":{"says":"I do them when my boss is on leave."},"stat":"ok"}
jsonp
JSONP (JSON with Padding) is a technique for passing the results of a server request back to the client as a JavaScript function containing JSON data. To use JSONP with the Cooper Hewitt API, you must pass a callback
paramater that refers to a function in the window
scope of the calling page.
Example request
curl -X GET 'https://api.www-4.collection.cooperhewitt.org/rest/?method=cooperhewitt.labs.whatWouldMicahSay&access_token=****&format=jsonp&callback=myCallbackFunction'
Example response
myCallbackFunction({"micah":{"says":"Always have 8-12 projects on the go."},"stat":"ok"})