Verbs

The JSON Activity Streams specification defines one base verb that is used to indicate the type of activity being produced: post. The specification permits implementers to define their own verbs or pull them from some of the other defined specifications, such as the standard Activity Streams specification or the Atom specification.

Before we look into some of the other potential verbs that implementers may use, let’s go through the verbs that are defined within the base Activity Streams specification. These verbs provide a good starting point for working with an activity.

Verbs may be referenced using their verb name (e.g., post, follow, join, etc.) or by the absolute URI to the schema, which also uses the verb name as the last part of the URI: http://activitystrea.ms/schema/1.0/verb.

So, for instance, an object with the type of share may use either of the following strings for the verb:

As with the object types, verbs are defined into a few categories, ranging from general verbs to more specialized verb categories. Let’s start with general verbs.

General verbs

The defined general verbs (Table 10-11) will deliver the vast majority of the functionality that you will need for an activity.

Table 10-11. General verbs

Verb

Description

add

Indicates that the actor has added the object to the target, such as adding a series of photo objects to an album target.

cancel

The actor has canceled the object, such as canceling an event.

checkin

The actor has ...

Get Programming Social Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.