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:
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
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"
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:
Name | Type | Required | Description |
---|---|---|---|
fields | String | false | Names of the fields to be returned |
Takes:
Retrieves:
Return Status:
HTTP Status Code | Description |
---|---|
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.
This service supports the following filters. Parameters, when used, should be wrapped in parentheses, and multiple values separated by commas. See the examples for clarification.
Filter | Params | Example |
---|---|---|
author | one or more person URIs, separated by commas | ?filter=author(http://domain/api/core/v3/people/12,http://domain/api/core/v3/people/853) |
notifications | ?filter=notifications | |
object | One or more types of objects | ?filter=object(document,video) |
type |
one or more of the following:
|
?filter=type(likes,social,profiles,endorsements) |
unread | ?filter=unread | |
verb |
one or more of the following:
|
?filter=verb(jive:commented,jive:liked) |
Query Parameters:
Name | Type | Required | Description |
---|---|---|---|
after | String | false | Date and time representing the minimum "last activity in a collection" timestamp for selecting inbox entries (cannot specify both after and before) |
before | String | false | Date and time representing the maximum "last activity in a collection" timestamp for selecting inbox entries (cannot specify both after and before) |
count | Integer | false | Maximum 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) |
filter | Object[] | false | Filter expression(s) used to select matching results (e.g. filter=type(likes,social,profiles,endorsements)). Note: likes, social, profiles, endorsements were added since 3.8. |
fields | String | false | the fields to be included in returned activities |
collapse | Boolean | false | Whether collapse the results such that there is only one entry per jive object |
oldestUnread | Boolean | false | Effective only when "collapse" is true. When this flag is set to true, service includes oldest unread item in collapsed list |
Retrieves:
Return Status:
HTTP Status Code | Description |
---|---|
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:
Name | Type | Required | Description |
---|---|---|---|
after | String | false | Date and time in ISO-8601 format representing last refresh time. |
max | Integer | false | The maximum number of new activity counts to return. Default is 50. |
exclude | Boolean | false | Flag indicating whether activity performed by the user should be omitted. Default is false. |
Retrieves:
Return Status:
HTTP Status Code | Description |
---|---|
400 (Bad Request) | An input field is missing or malformed |
Since: 3.5
Get Discovery Channel
GET /activities/discovery
Return the discovery stream, containing recommended, trending, and matters most items.
Query Parameters:
Name | Type | Required | Description |
---|---|---|---|
fields | String | false | Fields to be included in returned place entities |
Retrieves:
Return Status:
HTTP Status Code | Description |
---|---|
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 Frequent Content
GET /activities/frequent/content
Return the most frequently viewed content that is visible to the requesting person.
Query Parameters:
Name | Type | Required | Description |
---|---|---|---|
count | Integer | false | Maximum number of content entities to return in this request (bounded at 20) |
fields | String | false | Fields to be included in returned content entities |
filter | Object[] | false | Filter expression(s) used to select matching results (currently supports type only). Since 3.5. |
abridged | Boolean | false | Flag indicating that if content.text is requested, it will be abridged
(length shortened, HTML tags removed) |
Retrieves:
Return Status:
HTTP Status Code | Description |
---|---|
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:
Name | Type | Required | Description |
---|---|---|---|
count | Integer | false | Maximum number of person entities to return in this request (bounded at 20) |
fields | String | false | Fields to be included in returned person entities |
Retrieves:
Return Status:
HTTP Status Code | Description |
---|---|
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:
Name | Type | Required | Description |
---|---|---|---|
count | Integer | false | Maximum number of place entities to return in this request (bounded at 20) |
fields | String | false | Fields to be included in returned place entities |
Retrieves:
Return Status:
HTTP Status Code | Description |
---|---|
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:
Name | Type | Required | Description |
---|---|---|---|
before | String | false | Date and time representing the maximum "last activity" timestamp. Since 3.5. |
count | Integer | false | Maximum number of content entities to return in this request |
fields | String | false | Fields to be included in returned content entities |
filter | Object[] | false | Filter expression(s) used to select matching results (currently supports type only) |
abridged | Boolean | false | Flag indicating that if content.text is requested, it will be abridged
(length shortened, HTML tags removed) |
Retrieves:
Return Status:
HTTP Status Code | Description |
---|---|
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:
Name | Type | Required | Description |
---|---|---|---|
count | Integer | false | Maximum number of person entities to return in this request |
fields | String | false | Fields to be included in returned person entities |
Retrieves:
Return Status:
HTTP Status Code | Description |
---|---|
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:
Name | Type | Required | Description |
---|---|---|---|
count | Integer | false | Maximum number of place entities to return in this request |
fields | String | false | Fields to be included in returned place entities |
Retrieves:
Return Status:
HTTP Status Code | Description |
---|---|
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:
Name | Type | Required | Description |
---|---|---|---|
count | Integer | false | The maximum number of news to be returned. By default is 5. |
before | String | false | Date and time in ISO-8601 format that indicates the maximum date. By default is 'now' |
fields | String | false | The fields to be returned on each news |
Retrieves:
Return Status:
HTTP Status Code | Description |
---|---|
400 (Bad Request) | An input field is malformed |
403 (Forbidden) | The requesting user is not authorize to retrieve this information |
Since: 3.5
Get Social People
GET /activities/social/people
Return the people most frequently interacted with in the inbox that are visible to the requesting person.
Query Parameters:
Name | Type | Required | Description |
---|---|---|---|
count | Integer | false | Maximum number of person entities to return in this request (bounded at 100) |
fields | String | false | Fields to be included in returned person entities |
Retrieves:
Return Status:
HTTP Status Code | Description |
---|---|
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 |