Activity

Overview

Resources in activity will return a <feed> representing a mixture of events. Currently, the types of events are comment, review and tagged.

  • comment represents a comment posted by a user in response to a video. MUST contain a <content> element representing the text body of the comment.
  • review is exactly as above, but also includes a rating value on a 1-10 scale. The body of the comment and the rating are composed together in the <content> element in the format "Rating: X. [text here...]". The PHP client library parses this and exposes the rating and comment body separately.
  • tagged represents an event where a user applied a particular tag to the video. The entry will NOT include a <content> element, but will instead present a <media:category> containing a comma-separated list of tags applied.

Note: activity events are not individually addressable using a show method and do not have a globally unique id within the magnify system.

Resources

content

parameters
  • id (required)
  • page (default: 1)
  • per_page (default: 10)
example
activity/content?id=GTRNDQP88ARTVK1X

Retrieves all activity for the content item specified by the id parameter. Returns a list of mixed event items, identified by the <magnify:activity> element (see below).

Results

Feed Format

A standard feed with openseach metadata is produced, as described on the Feed page.

Entry Format

The entries returned from activity are unique in two ways: they do not have a <magnify:id>, and they are of not completely uniform type. The type of an individual entry is indicated by the <magnify:activity> element (comment, review, tagged). The entries are aggregated in this way for consistency with the way that 'activity' is treated on the main Magnify site. This approach also minimizes the number of calls to the API as well as the total number of REST resources.

The PHP client library contains helper classes to separate the feed into three virtual feeds containing items of only one type.

<entry>
  <link rel="user"
        href="http://example.magnify.net/api/user/show?id=YH65RWKLY4FGYQYW" />
  <updated>2008-06-13T13:21:37Z</updated>
  <author>
    <magnify:id>857HR4V69HLGG9DY</magnify:id>
    <name>kimberly</name>
    <uri>http://dev7.woof.magnify.net/api/user/show?id=857HR4V69HLGG9DY</uri>
  </author>

	<magnify:activity>comment</magnify:activity>
	<content>Cute!</content>

	OR

	<magnify:activity>review</magnify:activity>
	<content>Rating: 9.62. Superb, bravo! </content>

	OR
	<magnify:activity>tagged</magnify:activity>
	<media:category>dogs, cats</media:category>
</entry>

Important Elements

    link: links to relevant resources
    • user: a feed representing the user that performed this action
  • author: description of the user
    • name: the user's magnify handle or full name (whichever is available)
    • uri: a link to the feed representing the user (same as link rel=user above)
  • magnify:activity: the type of activity described by this entry (comment, review, tagged)
  • content, media:category: the text of the comment, rating or tags, as described above