static osapi.jive.corev3.actions

Actions are activities directed towards specific users. Actions show up in the "Actions" stream on a user's home page. Actions are created via the activities.create function. See Activity Creation for full details on how to create actions (and other kinds of activities). See the example below for a quick introduction to creating actions.

Examples:
Get a list of actions

Here is an example of getting a list of actions, i.e. activities that are directed to the requesting person. Actions have action links for the recipient to click.

 //Get 10 actions with actions.get static method
 var request = osapi.jive.corev3.actions.get({
        "count": 10
 });

 request.execute(function(data) {
     console.log("Fetched 10 activities!", data);
 });
Send an action

Here is an example of sending actions to 2 users. The actions have action links that perform HTTP POST requests when clicked. These will show up in a user's "Actions" stream of their home page.

 //Send actions to 2 users with action links
 var actionJSON = {
     "openSocial" : {
     "actionLinks" : [
         { "caption" : "Yes", "httpVerb" : "POST", "target" : "http://home.example.com/yes" },
         { "caption" : "No", "httpVerb" : "POST", "target" : "http://home.example.com/no" }
     ],
     "deliverTo" : [
         "https://example.jiveon.com/api/core/v3/people/2345",
         "https://example.jiveon.com/api/core/v3/people/3456",
     ]},
     "title" : "Can you donate food to the food drive?",
     "content" : "Please help out!",
 };

 var request = osapi.jive.corev3.activities.create(actionJSON);

 request.execute(function() {
     alert("Actions sent!");
 });

Methods

get(options)
GET /actions

Retrieves

Activity[]

Description

Return a list of inbox actions for the authenticated person, which match the specified criteria.

Options:
NameTypeRequiredDescription
afterStringfalseDate/time representing the minimum timestamp of a returned action. Cannot specify both after and before
beforeStringfalseDate/time representing the maximum timestamp of a returned action. Cannot specify both after and before
countIntegerfalseMaximum number of actions to be returned (default is 25)
entryStateStringfalseOptional filter to select only entries with one of the specified entry states (default is awaiting_action)
fieldsStringfalseNames of the fields to be returned
Retrieves:
  • Activity[]
  • get(options)
    GET /actions/{id}

    Retrieves

    Activity

    Description

    Return the specified action for the requesting person.

    Options:
    NameTypeRequiredDescription
    idStringtrueID of the action to get
    fieldsStringfalseNames of the fields to be returned
    Retrieves:
  • Activity
  • getCounts()
    GET /actions/counts

    Retrieves

    Object

    Description