Socialwg/Social API/OpenSocial Activity Streams API
The OpenSocial Activity Streams API is one of the submissions for this WG.
Overview
The Activity Streams API is a service that's part of the larger OpenSocial API. It provides CRUD functionality for ActivityEntry objects. "ActivityEntry", in OpenSocial parlance, is Activity Streams 1.0 JSON with OpenSocial-specific extensions.
The API also supports an XML representation, which directly translates the JSON properties to XML sub-elements.
OpenSocial applications can use the Activity Streams API to post new activities to a user's activity stream.
OpenSocial uses OAuth 1.0 for authentication, as well as other methods.
Entities
ActivityEntry
A direct mapping of the "Activity" type from Activity Streams. An event with a subject, verb, and object.
ActivityObject
A general-purpose entity -- a person, image, place, group, or extended object. Directly imported from Activity Streams 1.0.
Endpoints
Create
POST "/activitystreams/" User-Id "/@self"
Create a new activity entry for this user. Payload is an ActivityEntry.
Read
GET "/activitystreams/" User-Id "/" Group-Id [ "/" App-Id [ "/" (Activity-Id / Array<Activity-Id>) ] ]
This endpoint returns either:
- The activities created by a single user
- The activities created in a group
These can further be filtered by:
- Application: providing an application ID will provide only those activities created by a single application
- Activity ID: the caller call also specify individual activity IDs (or a list) to return
Update
PUT "/activitystreams/" User-Id "/@self" [ "/" Activity-Id ]
This endpoint takes a full ActivityEntry payload and updates the activity with the given ID. If the optional Activity-Id is left off, it uses the ID from the payload.
Delete
DELETE "/activitystreams/" User-Id "/@self/" Activity-Id
This endpoint will delete the given activity entry.
Introspection
GET "/activitystreams/@supportedFields"
Returns the supported fields (in Activity Streams payload?) for the container. Optional.
Review
This API was reviewed in the Socialwg/2014-12-02 telcon.