[ckan-dev] Activity streams API URLs?
Sean Hammond
sean.hammond at okfn.org
Wed Dec 21 11:05:02 UTC 2011
Hey, what endpoints should I add to the API for activity streams?
Here's what I'm thinking:
/api/VERSION/rest/events
All public events for the site.
/api/[VERSION]/rest/user/[NAME|ID]/events
A user's public activity stream.
Note that CKAN doesn't have API calls for getting users yet (as far as I
can see), so substrings of that URL such as:
/api/[VERSION]/rest/user/[NAME|ID]
/api/[VERSION]/rest/user
are not defined yet, although it's obvious what they should do if we
wanted to add them.
/api/[VERSION]/rest/user/[NAME|ID]/subscribed_events
Events that a user has received from things that they've subscribed to
(as opposed to events that the user has generated herself)
/api/[VERSION]/rest/package/[NAME|ID]/events
Activity stream for a package.
and so on for groups, tags, etc.
This is based on CKAN's existing API paths and on GitHub's events API:
http://developer.github.com/v3/events/
Another possibility would be to add activity streams to the API as a
top-level model resources, which is how they exist in the actual model:
/api/VERSION/rest/activity/ID
Where ID would be the ID of an object such as a user or package. But
this requires CKAN ID's to be unique across objects of different types
(I'm not sure whether they are) and I don't know what we should return
if someone visits the substring of the URL:
/api/VERSION/rest/activity
An activity stream for the entire site? Or 404?
More information about the ckan-dev
mailing list