Activity

Activity Service

REST endpoint providing access to an activity stream containing all activity visible to the requesting person.

See Activity Use Cases for usage examples.

Examples:
Create Activity

Simplest possible example of creating a new activity stream entry, based on the specified fields. See Activity Creation for full details on creating activity stream entries programmatically.

curl -u bob:password -H "Content-Type: application/json" --data '{"title" : "Simple activity title", "content": "Read this"}' http://jive.mysite.com/api/core/v3/activities

Get Activities

Curl example of getting a list of 5 activities with only summary data, based on the specified options.

curl -u bob:password "http://example.jiveon.com/api/core/v3/activities?count=5&fields=@summary"

Get activities

Python example of getting the current user's activities:

 import urllib2, base64

 uri = "/api/core/v3/activities?count=5"
 base_url = "http://jive.mycompany.com"
 url = base_url + uri

 user = "jimmy.mak"
 password = "somePassword"

 auth = "Basic " + base64.encodestring('%s:%s' % (user, password)).replace("\n","");

 headers = { "Authorization": auth }
 request = urllib2.Request(url, None, headers )

 try:
     json = urllib2.urlopen(request).read()
 except urllib2.HTTPError, e:
     print e.code
     print e.read()

 json = re.sub(r"^throw.*;\s*","",json) //Remove the security string from the top of the response
 print json

Create Activity

POST /activities

Create a new activity stream entry based on the characteristics in the incoming activity object.

Query Parameters:
NameTypeRequiredDescription
fieldsStringfalseNames of the fields to be returned
Takes:
  • Activity containing the required data to construct a new activity stream entry
  • Retrieves:
  • Activity representing the newly created activity
  • Activity containing the new activity stream entry to create
  • Activity reoresenting the newly created activity stream entry
  • Return Status:
    HTTP Status CodeDescription
    201 (Created)Request was successful
    400 (Bad Request)An input field is missing or malformed
    403 (Forbidden)You are not allowed to create this activity stream entry

    Get Activity

    GET /activities

    Return the specified activities from the stream of all activity visible to the requesting person.

    Query Parameters:
    NameTypeRequiredDescription
    afterStringfalseDate and time representing the minimum "last activity in a collection" timestamp for selecting inbox entries (cannot specify both after and before)
    beforeStringfalseDate and time representing the maximum "last activity in a collection" timestamp for selecting inbox entries (cannot specify both after and before)
    countIntegerfalseMaximum number of activities to return in this request (you may get more activities than this in order to get all of the activities in the last collection)
    fieldsStringfalsethe fields to be included in returned activities
    Retrieves:
  • Activity[]
  • Return Status:
    HTTP Status CodeDescription
    200 (OK)Request was successful
    400 (Bad Request)The specified stream ID is missing or malformed
    403 (Forbidden)The requesting user is not allowed to retrieve activities for the specified stream
    404 (Not Found)The activities or the specified stream is not found

    Get Count

    GET /activities/count

    Return count of new activities for the given user since the provided time.

    Query Parameters:
    NameTypeRequiredDescription
    afterStringfalseDate and time in ISO-8601 format representing last refresh time.
    maxIntegerfalseThe maximum number of new activity counts to return. Default is 50.
    excludeBooleanfalseFlag indicating whether activity performed by the user should be omitted. Default is false.
    Retrieves:
  • count of new activities for the given user since the provided time
  • Return Status:
    HTTP Status CodeDescription
    400 (Bad Request)An input field is missing or malformed
    Since: 3.5

    Get Frequent Content

    GET /activities/frequent/content

    Return the most frequently viewed content that is visible to the requesting person.

    Query Parameters:
    NameTypeRequiredDescription
    countIntegerfalseMaximum number of content entities to return in this request (bounded at 20)
    fieldsStringfalseFields to be included in returned content entities
    abridgedBooleanfalseFlag indicating that if content.text is requested, it will be abridged (length shortened, HTML tags removed)
    Retrieves:
  • Content[] representing frequently viewed content objects
  • Return Status:
    HTTP Status CodeDescription
    200 (OK)Request was successful
    400 (Bad Request)Any required parameters are missing or malformed
    403 (Forbidden)The requesting user is not allowed to retrieve frequently viewed content
    404 (Not Found)The content is not found

    Get Frequent People

    GET /activities/frequent/people

    Return the most frequently viewed people that are visible to the requesting person.

    Query Parameters:
    NameTypeRequiredDescription
    countIntegerfalseMaximum number of person entities to return in this request (bounded at 20)
    fieldsStringfalseFields to be included in returned person entities
    Retrieves:
  • Person[] representing frequently viewed people
  • Return Status:
    HTTP Status CodeDescription
    200 (OK)Request was successful
    400 (Bad Request)Any required parameters are missing or malformed
    403 (Forbidden)The requesting user is not allowed to retrieve frequently viewed people
    404 (Not Found)The people are not found

    Get Frequent Places

    GET /activities/frequent/places

    Return the most frequently viewed places that are visible to the requesting person.

    Query Parameters:
    NameTypeRequiredDescription
    countIntegerfalseMaximum number of place entities to return in this request (bounded at 20)
    fieldsStringfalseFields to be included in returned place entities
    Retrieves:
  • Place[] representing frequently viewed places
  • Return Status:
    HTTP Status CodeDescription
    200 (OK)Request was successful
    400 (Bad Request)The required parameters are missing or malformed
    403 (Forbidden)The requesting user is not allowed to retrieve frequently viewed places
    404 (Not Found)The places are not found

    Get Recent Content

    GET /activities/recent/content

    Return the most recently viewed content that is visible to the requesting person.

    Query Parameters:
    NameTypeRequiredDescription
    beforeStringfalseDate and time representing the maximum "last activity" timestamp. Since: 3.5
    countIntegerfalseMaximum number of content entities to return in this request
    fieldsStringfalseFields to be included in returned content entities
    abridgedBooleanfalseFlag indicating that if content.text is requested, it will be abridged (length shortened, HTML tags removed)
    Retrieves:
  • Content[] representing recently viewed content
  • Return Status:
    HTTP Status CodeDescription
    200 (OK)Request was successful
    400 (Bad Request)Any required parameters are missing or malformed
    403 (Forbidden)The requesting user is not allowed to retrieve recently viewed content
    404 (Not Found)The content is not found

    Get Recent People

    GET /activities/recent/people

    Return the most recently viewed people that are visible to the requesting person.

    Query Parameters:
    NameTypeRequiredDescription
    countIntegerfalseMaximum number of person entities to return in this request
    fieldsStringfalseFields to be included in returned person entities
    Retrieves:
  • Person[] representing recently viewed people
  • Return Status:
    HTTP Status CodeDescription
    200 (OK)Request was successful
    400 (Bad Request)Any required parameters are missing or malformed
    403 (Forbidden)The requesting user is not allowed to retrieve recently viewed people
    404 (Not Found)The people are not found

    Get Recent Places

    GET /activities/recent/places

    Return the most recently viewed places that are visible to the requesting person.

    Query Parameters:
    NameTypeRequiredDescription
    countIntegerfalseMaximum number of place entities to return in this request
    fieldsStringfalseFields to be included in returned place entities
    Retrieves:
  • Place[] representing recently viewed places
  • Return Status:
    HTTP Status CodeDescription
    200 (OK)Request was successful
    400 (Bad Request)Any required parameters are missing or malformed
    403 (Forbidden)The requesting user is not allowed to retrieve recently viewed places
    404 (Not Found)The places are not found

    Get Social News

    GET /activities/social/news

    Return a paginated list of social news for the authenticated user.

    Query Parameters:
    NameTypeRequiredDescription
    countIntegerfalseThe maximum number of news to be returned. By default is 5.
    beforeStringfalseDate and time in ISO-8601 format that indicates the maximum date. By default is 'now'
    fieldsStringfalseThe fields to be returned on each news
    Retrieves:
  • Activity[] representing social news
  • Return Status:
    HTTP Status CodeDescription
    400 (Bad Request)An input field is malformed
    403 (Forbidden)The requesting user is not authorize to retrieve this information
    Since: 3.5