This specification details the serialization of a stream of social activities using the JSON format. Activities are important in that they allow individuals to process the latest news of people and things they care about.
1.
Introduction
2.
Notational Conventions
3.
JSON Serialization
3.1.
Example Activities
3.2.
Activity Serialization
3.3.
Media Link Serialization
3.4.
Object Serialization
3.5.
Collection Serialization
4.
The Activity Stream JSON Document
5.
Comparison of Identifier Values
6.
The "post" Verb
6.1.
Implied "post" Activity
7.
The "activity" Object Type
8.
Extension Object Types and Verbs
9.
Other Representations
10.
Requirements for Re-publishers
11.
Security Considerations
12.
IANA Considerations
13.
License
14.
Errata
15.
Normative References
Appendix A.
Acknowledgements
§
Authors' Addresses
In its simplest form, an activity consists of an actor, a verb, an object, and a target. It tells the story of a person performing an action on or with an object -- "Geraldine posted a photo to her album" or "John shared a video". In most cases these components will be explicit, but they may also be implied.
It is a goal of this specification to provide sufficient metadata about an activity such that a consumer of the data can present it to a user in a rich human-friendly format. This may include constructing readable sentences about the activity that occurred, visual representations of the activity, or combining similar activities for display.
The basic properties that comprise the description of an activity are defined in the following sections.
Within this specification, an object is a thing, real or imaginary, which participates in an activity. It may be the entity performing the activity, or the entity on which the activity was performed. An object consists of properties defined in the following sections. Certain object types may further refine the meaning of these properties, or they may define additional properties.
Some types of objects may have an alternative visual representation in the form of an image, video or embedded HTML fragments. A Media Link represents a hyperlink to such resources.
An Activity Stream is a collection one or more individual activities. The relationship between the activities within the collection is undefined by this specification.
The text of this specification provides the sole definition of conformance. Examples in this specification are non-normative.
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC2119] ( Bradner, S., “Key words for use in RFCs to Indicate Requirement Levels,” March 1997. ) .
This specification allows the use of IRIs [RFC3987] ( Duerst, M. and M. Suignard, “Internationalized Resource Identifiers (IRIs),” January 2005. ) . Every URI [RFC3986] ( Berners-Lee, T., Fielding, R., and L. Masinter, “Uniform Resource Identifier (URI),” January 2005. ) is also an IRI, so a URI may be used wherever below an IRI is named. There are two special considerations: (1) when an IRI that is not also a URI is given for dereferencing, it MUST be mapped to a URI using the steps in Section 3.1 of [RFC3987] ( Duerst, M. and M. Suignard, “Internationalized Resource Identifiers (IRIs),” January 2005. ) and (2) when an IRI is serving as an id value, it MUST NOT be so mapped.
Activities are serialized using the JSON format, as defined in [RFC4627] ( Crockford, D., “The application/json Media Type for JavaScript Object Notation (JSON),” July 2006. ) . Alternative serializations MAY be used but are outside the scope of this specification.
In the JSON serialization, absent properties MAY be represented either by an explicit declaration of the property whose value is null or by omitting the property declaration altogether at the option of the publisher; these two representations are semantically equivalent. If a property is having a value whose type is a JSON array, the absence of any items in that array MUST be represented by omitting the property entirely or publishing it with the value null, and MUST NOT be represented as an empty array, except as otherwise stated in the definition of a specific property.
Unless otherwise specified, all properties specifying date and time values within the JSON serialization, including extensions, MUST conform to the "date-time" production in [RFC3339] ( Klyne, G., “Date and Time on the Internet: Timestamps,” July 2002. ) . In addition, an uppercase "T" character MUST be used to separate date and time, and an uppercase "Z" character MUST be present in the absence of a numeric time zone offset.
Following is a simple, minimal example of a JSON serialized activity: