romdim Dylan conway

Activity API

Referring to social, health, behavioural activity reflected in multiple cloud-based services ranging from Social, Photo and Video Sharing to Health and Location-based Services. It includes all the social and personal activities of a user, and is related with the logging activity of a device.

!{width:70%}ActivityAPI.png!

Note: The schema above does not imply that the connections must be considered as additional nodes or just connections with properties. It is a matter of implementation of how a social connection will be designed in the storage. For that case, we have the "follows" connection which is direct and the "like" connection which is presented as an object.

The objects that are generated in this API are directly connected with the user object; a status, a badge, a measurement can describe the status/situation/performance of a user, even if it is private, visible to friends or public. Additionally, the connections in this API refer to connections with any other object that is interesting to know.

Objects

Primary Objects

Objects Description Reference Activities Mapping
[badge] Represents a badge or award granted to an object (typically a person object) AS Schema [Badge Mapping]
[checkin] A validation of being in a place Foursquare [Checkin Mapping]
[event] Represents an event that occurs at a certain location during a particular period of time. AS Schema [Event Mapping]
[measurement] an enry for a measurement (blood pressure, weight, diabetes, general body) Runkeeper [Measurement Mapping]
[note] Represents a short-form text message. This object is intended primarily for use in "micro-blogging" scenarios and in systems where users are invited to publish short, often plain-text messages whose useful lifespan is generally shorter than that of an article of weblog entry. A note is similar in structure to an article, but typically does not have a title or distinct paragraphs and tends to be much shorter in length. AS Schema [Note Mapping]
[nutrition] An entry for a user's diet Runkeeper [Nutrition Mapping]
[question] Represents a question or a poll. Objects of this type MAY contain an additional options property whose value is an Array of possible answers to the question in the form of Activity Stream objects of any type. Facebook [Question Mapping]
[sleep] the measured sleep activity Runkeeper [Sleep Mapping]
[status] A shorter [note] AS Schema [Status Mapping]
[workout] Represents a physical activity (e.g. running, background activity) Runkeeper [Workout Mapping]

Methods for Primary Objects

Below there are the generally supported methods that Objects from Activity API support. For special cases, see every object separately.

Method Details Call Method API path Properties Response
Get an Activity object This method returns an object with its properties [REST] #GET
API_PATH/{OBJECT_ID}
OBJECT_ID an Activity object
Get all Activity objects for an account This method returns all the Activity objects that have been published under an account. The Activity objects are of the same type (i.e. status, note, sleep etc.) [REST] #GET
API_PATH/{ACCOUNT_ID}/objects
e.g. API_PATH/12312313/notes
ACCOUNT_ID A list of same-type Activity objects
Get Activity objects for an OPENi user Gets all Activity objects for the authenticated user, for all her accounts, unless they are filtered. [REST] #GET
API_PATH/me/objects
e.g. API_PATH/me/statuses
accounts={ACCOUNT_ID} A list of same-type Activity objects
Post an Activity object to a simple account This method uploads an object to an account, given the object. [REST] #POST
API_PATH/{ACCOUNT_ID}/objects
e.g. API_PATH/12312313/statuses
ACCOUNT_ID, {OBJECT}, Activity_content A success or error code
Post an Activity object to multiple services This method uploads an object to multiple services, given the object and all the account_ids. [REST] #POST
API_PATH/me/objects
e.g. API_PATH/me/statuses
{OBJECT}, Activity_content, accounts={ACCOUNT_ID}. A success or error code
Edit an Activity object This method can update properties and not Activity content. If the Activity_content must change, the object must be deleted and posted again as a new object. It is allowed only for the owner of the content or someone with permissions. [REST] #PUT
API_PATH/{OBJECT_ID}
OBJECT_ID A success or error code
Delete an Activity object This method deletes an object, owned by the authenticated user [REST] #DELETE
API_PATH/{OBJECT_ID}
OBJECT_ID A success or error code
Post an Activity object to an aggregation This method uploads an object to an aggregation, given the object. [REST] #POST
API_PATH/{AGGREGATION_ID}/objects
e.g. API_PATH/5553_12312313/notes
AGGREGATION_ID, {OBJECT} A success or error code

Secondary Objects (connections)

These objects are a special category of objects; they are connections on existing objects (e.g. a comment to a photo) but they may also be aggregated under a user to return his activity through various accounts (e.g. get all likes of a user). Every object from this category has an owner (subject of the activity) but they are directly connected with another object too.

Objects Description Reference Activities Mapping
[like] This connection refers to most objects that have a social aspect, it is unique per user and has a timestamp. It declares awareness, approval or support. AS Schema [Like Mapping]
[comment] This connection leaves a text comment to another object. AS Schema [Comment Mapping]
[dislike] This connection refers to other objects, and declare AS Schema [Dislike Mapping]
[favorite] This connection pins an object as favorite. [Favorite Mapping]
[friendship] A mutual connection between two users. When there is a "follow" relationship, an "/incoming" or "/outgoing" additional path can be used under a GET method. Twitter API v1.1 [Friendship Mapping]
[rsvp] The attending reply to an event [RSVP Mapping]
[question_option] A reply to a [question] object [Question option mapping]
[tag] The connection of a [user] object with another object e.g. [checkin], [photo], [status] [Tag Mapping]

Methods for Secondary Objects

Method Details Call Method API path Properties Response
Get a connection from an Activity object This method returns a list of objects that are connected with the user. [REST] #GET
API_PATH/{OBJECT_ID}/connection
e.g. API_PATH/324234_33/likes or API_PATH/324234_33/comments or API_PATH/1433434/rsvp
OBJECT_ID an Activity object
Get a connection for a specific account This method returns a list of connections, aggregated, for a specific account belonging to the authenticated user. [REST] #GET
API_PATH/{ACCOUNT_ID}/connection
e.g. API_PATH/23/likes or API_PATH/23/rsvp
ACCOUNT_ID a list of connectionst
Get a type of connections across multiple accounts, for a specific OPENi user This method returns a list of connections, aggregated, for a specific OPENi user. [REST] #GET
API_PATH/me/connection
e.g. API_PATH/me/likes or API_PATH/me/rsvp
- a list of connections
Post a connection to an Activity object This method posts a connection towards an object. Especially for "friend", it creates a friend request or following relationship. [REST] #POST
API_PATH/{OBJECT_ID}/connection
e.g. API_PATH/324234_33/likes or API_PATH/324234_33/comments or API_PATH/1433434/rsvp
OBJECT_ID, {object} a success code
Delete a connection from an Activity object This method deletes a connection (BUT in order to delete a comment, the comment_id is required) [REST] #DELETE
API_PATH/{OBJECT_ID}/connection
e.g. API_PATH/324234_33/likes or or API_PATH/1433434/rsvp
OBJECT_ID a success code

Aggregations

Aggregation Description Reference Activities Mapping
[notebook] An aggregation of notes [Notebook mapping]
Method Details Call Method API path Properties Response
Get an aggregation This method returns an aggregation with its properties [REST] #GET
API_PATH/{AGGEGATION_ID}
AGGEGATION_ID An aggregation object, with attached a list of its objects.
Get all aggregations for an account This method returns all the required aggregations that have been published under an account. The aggregations are of the same type (i.e. folder, album, playlist etc.) [REST] #GET
API_PATH/{ACCOUNT_ID}/aggegations
e.g. API_PATH/12312313/albums
ACCOUNT_ID A list of same-type aggregations
Get aggregations for an OPENi user Gets all aggregations for the authenticated user, for all her accounts, unless they are filtered. [REST] #GET
API_PATH/me/aggregations
e.g. API_PATH/555/folders
accounts={ACCOUNT_ID} A list of same-type aggregations
Create an aggregation This method creates an aggregation to an account, given the aggregation. [REST] #POST
API_PATH/{ACCOUNT_ID}/aggregations
e.g. API_PATH/12312313/playlists
ACCOUNT_ID, {AGGREGATION} A success or error code
Edit an aggregation This method can update properties of an aggregation. It is allowed only for the owner of the content or someone with permissions. [REST] #PUT
API_PATH/{AGGREGATION_ID}
AGGREGATION_ID, {AGGREGATION} A success or error code
Delete an aggregation This method deletes an aggregation, owned by the authenticated user [REST] #DELETE
API_PATH/{AGGREGATION_ID}
AGGREGATION_ID A success or error code

Connections are related to Aggregations just like the Objects. But the service must support the relative activity.


Related

Wiki: REST
Wiki: notebook
Wiki: Notebook mapping
Wiki: tag
Wiki: user
Wiki: checkin
Wiki: photo
Wiki: status
Wiki: Tag Mapping
Wiki: question_option
Wiki: question
Wiki: Question option mapping
Wiki: rsvp
Wiki: RSVP Mapping
Wiki: friendship
Wiki: Friendship Mapping
Wiki: favorite
Wiki: Favorite Mapping
Wiki: dislike
Wiki: Dislike Mapping
Wiki: comment
Wiki: Comment Mapping
Wiki: like
Wiki: Like Mapping
Wiki: workout
Wiki: Workout Mapping
Wiki: note
Wiki: Status Mapping
Wiki: sleep
Wiki: Sleep Mapping
Wiki: Question Mapping
Wiki: nutrition
Wiki: Nutrition Mapping
Wiki: Note Mapping
Wiki: measurement
Wiki: Measurement Mapping
Wiki: event
Wiki: Event Mapping
Wiki: Checkin Mapping
Wiki: badge
Wiki: Badge Mapping
Wiki: T31-_OPENi_APIs_Specification
Wiki: T3.1- OPENi APIs Specification