Activities

Manage activity stream in TeamPulse.

GET /activities - Get all activities for the authenticated user.

GET /activities/unread - Get information about the unread activities for the authenticated user.

POST /activities/share - Share a message in the activity stream

PUT /activities/{id} - Update an activity

Activity Model

The object representing an activity has the following properties:

id: integer (Read-only) - ID of the activity.

projectId: integer (Read-only) - ID of the project to which this activity is related to. Can be null.

content: string (Read-only) - The content describing the activity.

iconUrl: string (Read-only) - The URL to the thumbnail image of the user who performed the activity.

author: string (Read-only) - The display name of the user who performed the activity.

isFlagged: boolean (Read-only) - A value saying if this activity is flagged or not based on the notification settings of the authenticated user.

isRead: boolean (Read-only) - A value saying if this activity is read by the authenticated user.

system: string (Read-only) - The system source of the activity. By default this is 'TeamPulse'.

systemEvent: string (Read-only) - The kind of the event. Allowed values are 'WorkItemChanged', 'PersonalMessage' and 'SystemMessage'.

workItemId: int (Read-only) - The ID of the work item to which the activity is related to. Can be null.

commentType: string (Read-only) - The type of the comment in case the activity is for a comment. Allowed values are 'TeamPulse' and 'FeedbackPortal'.

createdBy: string - The name of the user who created the activity.

createdAt: DateTime - The date when the activity is created.

lastModifiedBy: string - The name of the user who last modified the activity.

lastModifiedAt: DateTime - The date when the activity is last modified.

Unread Activities Model

The object representing the information about the unread activities has the following properties:

flagged: int (Read-only) - The count of the unread flagged activities.

unflagged: int (Read-only) - The count of the unread non-flagged activities.

total: int (Read-only) - The count of all unread activities.

Message Share Model

The object representing a shared message has the following properties:

message: string (Required) - The content of the message to be shared in the activity stream.

Resource Url

To make API requests use the URL [teampulse]/api/v1 where [teampulse] is the URL to the TeamPulse instance which you want to manage via the API.

Example:
[teampulse]/api/v1/activities

Get activities

GET /activities - Get all activities for the authenticated user.

OData $filter and $orderby options can be supplied to filter and order the results. $top and $skip to get top N items and skip the top M. Read more how to use the OData options

Response

HTTP/1.1 200

{
    "totalResults": 4,
    "top": 4,
    "results": [
        {
            "id": 5,
            "projectId": null,
            "content": "Paul Smith shared:<br />\nSome shared message that will be displayed in the activity stream.\n",
            "iconUrl": "http://teampulse:9898/UserMenu/GetCachedThumbnailedUserImage?name=psmith",
            "author": "Paul Smith",
            "isFlagged": false,
            "isRead": false,
            "system": "TeamPulse",
            "systemEvent": "PersonalMessage",
            "workItemId": null,
            "commentType": null,
            "createdBy": "psmith",
            "createdAt": "2013-10-10T15:05:52.407",
            "lastModifiedBy": "psmith",
            "lastModifiedAt": "2013-10-10T15:05:52.407"
        },
        {
            "id": 7,
            "projectId": 2,
            "content": "John Smith added <a href=\"http://teampulse:9898/view#item/44917\"><span class=\"item-id feedback\"><span class=\"type-icon\" title=\"feedback\">[feedback]</span></span>&nbsp;Split a story: Create a new story from existing one and copy the existing "not done" tasks (most usefull when close the iteration)</a>\n",
            "iconUrl": "http://teampulse:9898/UserMenu/GetCachedThumbnailedUserImage?name=TELERIK%5Cjsmith",
            "author": "John Smith",
            "isFlagged": false,
            "isRead": false,
            "system": "TeamPulse",
            "systemEvent": "WorkItemChanged",
            "workItemId": 44917,
            "commentType": null,
            "createdBy": "jsmith",
            "createdAt": "2013-10-10T15:34:16.99",
            "lastModifiedBy": "jsmith",
            "lastModifiedAt": "2013-10-10T15:34:16.99"
        },
        {
            "id": 26,
            "projectId": 2,
            "content": "Paul Smith commented on <a href=\"http://teampulse:9898/view#item/44918\"><span class=\"item-id bug\"><span class=\"type-icon\" title=\"bug\">[bug]</span></span>&nbsp;Styles are not displayed correctly</a>:<br />\nAlso the title should be bigger.\n",
            "iconUrl": "http://teampulse:9898/UserMenu/GetCachedThumbnailedUserImage?name=psmith",
            "author": "Paul Smith",
            "isFlagged": false,
            "isRead": false,
            "system": "TeamPulse",
            "systemEvent": "WorkItemChanged",
            "workItemId": 44918,
            "commentType": "TeamPulse",
            "createdBy": "psmith",
            "createdAt": "2013-10-10T15:37:13.72",
            "lastModifiedBy": "psmith",
            "lastModifiedAt": "2013-10-10T15:37:13.72"
        },
        {
            "id": 28,
            "projectId": 1,
            "content": "John Smith commented on <a href=\"http://teampulse:9898/view#item/44914\"><span class=\"item-id feedback\"><span class=\"type-icon\" title=\"feedback\">[feedback]</span></span>&nbsp;Sample feedback</a>:<br />\nComment in portal\n",
            "iconUrl": "http://teampulse:9898/UserMenu/GetCachedThumbnailedUserImage?name=TELERIK%5Cjsmith",
            "author": "John Smith",
            "isFlagged": false,
            "isRead": false,
            "system": "TeamPulse",
            "systemEvent": "WorkItemChanged",
            "workItemId": 44914,
            "commentType": "FeedbackPortal",
            "createdBy": "jsmith",
            "createdAt": "2013-10-10T15:41:11.487",
            "lastModifiedBy": "jsmith",
            "lastModifiedAt": "2013-10-10T15:41:11.487"
        },
        ...
    ]
}

Get unread activities information

GET /activities/unread - Get information about the unread activities for the authenticated user.

Response

HTTP/1.1 200

{
    "flagged": 3,
    "unflagged": 2,
    "total": 5
}

Share a message

POST /activities/share - Share a message in the activity stream

Request

{
   "message": "Some shared message that will be displayed in the activity stream."
}

Response

HTTP/1.1 201

{
    "message": "Paul Smith shared:\nSome shared message that will be displayed in the activity stream."
}

Update an activity

PUT /activities/{id}

The update can be done partially so only the properties that need to be updated can be provided in the request. An activity can be marked as read or unread with updating the property isRead.

Request

{
  "isRead": true
}

Response

HTTP/1.1 200

{
    "id": 5,
    "projectId": null,
    "content": "Paul Smith shared:<br />\nSome shared message that will be displayed in the activity stream.\n",
    "iconUrl": "http://teampulse:9898/UserMenu/GetCachedThumbnailedUserImage?name=psmith",
    "author": "Paul Smith",
    "isFlagged": false,
    "isRead": true,
    "system": "TeamPulse",
    "systemEvent": "PersonalMessage",
    "workItemId": null,
    "commentType": null,
    "createdBy": "psmith",
    "createdAt": "2013-10-10T15:05:52.407",
    "lastModifiedBy": "psmith",
    "lastModifiedAt": "2013-10-10T15:05:52.407"
}