Hive NYC would like the current member list on their Wordpress-based website to be pulled directly from the directory, so they don't have to maintain it in two separate places.
One way to support this is to add a simple API endpoint, e.g.:
GET /api/v1/cities/:city/members
This could return a JSON response such as:
[
{"name": "American Museum of Natural History",
"website": "http://www.amnh.org/"},
{"name": "WNYC's Radio Rookies",
"website": "http://www.radiorookies.org/"}
]
A simple WordPress plugin or JS include on the Hive NYC site could then grab this JSON and drop it into a template.
Note that there is currently a JSON endpoint at /find.json, but this is a private API, in that it's used by Ajax code on the directory search page, and uses the current user's session cookie for authentication. Everything under the /api/ endpoint, in contrast, will be for external clients like the Hive NYC wordpress site. If and when we offer privileged data through this API, requests will probably be authenticated through OAuth or somesuch, as opposed to session cookie.
Hive NYC would like the current member list on their Wordpress-based website to be pulled directly from the directory, so they don't have to maintain it in two separate places.
One way to support this is to add a simple API endpoint, e.g.:
This could return a JSON response such as:
A simple WordPress plugin or JS include on the Hive NYC site could then grab this JSON and drop it into a template.
Note that there is currently a JSON endpoint at
/find.json
, but this is a private API, in that it's used by Ajax code on the directory search page, and uses the current user's session cookie for authentication. Everything under the/api/
endpoint, in contrast, will be for external clients like the Hive NYC wordpress site. If and when we offer privileged data through this API, requests will probably be authenticated through OAuth or somesuch, as opposed to session cookie.