Activities

GET /api/conversations/:conversation_id/activities
get page of activities for a conversation

Params

Param name Description
conversation_id
optional

conversation to load the activities for


Value: Must be a Integer
page
optional

page of results to return


Value: Must be a Integer

Response Fields

activities array of activity results Array[Activity]
activity[id] unique id for this activity Integer
activity[verb] type of activity (post, update, join, leave) String
activity[title] descriptive sentence of the activity String
activity[actor[displayName]] full name of the activity actor String
activity[actor[firstName]] first name of the activity actor String
activity[actor[image][url]] image url for the activity actor String
activity[object[objectType]] data type of the activity (note, image, collection) String
activity[object[shared_message]] shared Message referenced by this activity. Contains all Message response fields except likes, comments, shared_message Hash
activity[object[replied_to_id]] id for the message or comment that this activity is in response to Integer
activity[object[replied_to_type]] the type of object that this activity is a reply to, valid values are "SocialObject" and "Comment" String
activity[object[replied_to_message_id]] id for either the message that this activity was a reply to or the parent message of the comment that this activity was a reply to Integer
activity[object[replied_to]] the object that this activity is a reply to. Contains all Message or Comment response fields except likes and message comments Hash
activity[object[client_provided_guid]] the client-provided unique identifier for the object, if any String
activity[published] timestamp when the activity was created DateTime
activity[location[longitude]] location longitude of the activity Integer
activity[location[latitude]] location latitude of the activity Integer
activity[generator[name]] name of client application that generated the activity String
activity[generator[url]] informational url of the client application that generated the activity String
activity[attachments] array of objects associated to this object (image, file) Array
activity[target] target of the activity (ex: Joe joined the *conversation*) Object

Example Curl Commands

curl -X GET -v --basic -u "emily@socialcast.com:demo" https://demo.socialcast.com/api/conversations/2/activities.json

Examples

GET 
200
{
  "activities": [
    {
      "id": 6,
      "verb": "post",
      "actor": {
        "id": 145,
        "displayName": "J'øhn133 D'øe131",
        "firstName": "J'øhn133",
        "image": {
          "height": 140,
          "width": 140,
          "url": "https://socialcast.socialcast.test/assets-test/v6/avatars/default_user_square140-7da7e1d98b33ef152280b1f653cfd80e2db24b01b625a72abc320673eea5af53.png",
          "is_system_default": true
        },
        "inactive": false,
        "terminated": false
      },
      "object": {
        "id": 4,
        "objectType": "note",
        "replied_to_id": 63,
        "replied_to_type": "SocialObject",
        "replied_to_message_id": 63,
        "replied_to": {
          "id": 63,
          "user": {
            "id": 147,
            "first_name": "J'øhn135",
            "last_name": "D'øe133",
            "name": "J'øhn135 D'øe133",
            "html_name": "J'øhn135 D'øe133",
            "url": "https://socialcast.socialcast.test/users/147-j%C3%B8hn135d%C3%B8e133",
            "avatars": {
              "is_system_default": true,
              "id": null,
              "square16": "https://socialcast.socialcast.test/assets-test/v6/avatars/default_user_square16-3b951350d61d203ece2fa5dd274fa7bd35275e132c17310d9006514f8839c857.png",
              "square30": "https://socialcast.socialcast.test/assets-test/v6/avatars/default_user_square30-6db66ac25c338d1e548a68465e2723ff63367c2aafbcc01db24c83964056b892.png",
              "square45": "https://socialcast.socialcast.test/assets-test/v6/avatars/default_user_square45-16865426333e244c59076d4f2475b711ed1ff9d12c97f4cf354f373a0170a1fd.png",
              "square70": "https://socialcast.socialcast.test/assets-test/v6/avatars/default_user_square70-1708999e8f1fea583408d7fc64b2177f853e4123bea2ffcf35f4839c8697e0ba.png",
              "square140": "https://socialcast.socialcast.test/assets-test/v6/avatars/default_user_square140-7da7e1d98b33ef152280b1f653cfd80e2db24b01b625a72abc320673eea5af53.png"
            },
            "username": "Jøhn135Døe133",
            "active": true,
            "terminated": false,
            "inactive": false,
            "role": "member",
            "type": "User",
            "title": null,
            "out_of_office": false,
            "out_of_office_on": null,
            "back_in_office_on": null,
            "company_login": null
          },
          "title": "",
          "body": "blørg & stuff 14",
          "html_body": "<div class=\"markdown-body\"><p>blørg &amp; stuff 14</p></div>",
          "action": "",
          "verb": null,
          "message_type": "status_message",
          "icon": null,
          "url": "https://socialcast.socialcast.test/api/messages/63",
          "permalink_url": "https://socialcast.socialcast.test/messages/63",
          "external_url": null,
          "created_at": "2017-04-23T03:16:28+00:00",
          "updated_at": "2017-04-23T03:16:28+00:00",
          "attachments": [],
          "media_files": [],
          "contains_url_only": null,
          "external_resources": [],
          "tags": [],
          "last_interacted_at": 1492917388,
          "group": {},
          "category_id": null,
          "recipients": [],
          "thumbnail_url": null,
          "player_url": null,
          "player_params": null,
          "likable": null,
          "ratable": false,
          "rating": null,
          "ratings_average": null,
          "ratings_count": null,
          "editable": null,
          "deletable": null,
          "watchable": false,
          "watch": null,
          "flag": null,
          "source": null,
          "poll": null,
          "embed": null,
          "hidden": null,
          "subscribed": null,
          "groups": [],
          "extensions": [],
          "new_group_id": null,
          "new_group_archived_at": null,
          "days_of_stickiness": 0,
          "sticky_for_current_user": false,
          "shareable": false,
          "share_count": 0,
          "client_provided_guid": null,
          "comments_count": 0,
          "comments": [],
          "likes": [],
          "likes_count": 0,
          "shared_message": null,
          "commentable": false
        },
        "client_provided_guid": null,
        "content": "testing & bläh & stuff 4",
        "html_body": "<div class=\"markdown-body\"><p>testing &amp; bläh &amp; stuff 4</p></div>",
        "shared_message": null
      },
      "title": "J'øhn133 D'øe131 sent a chat message",
      "published": "2017-04-22T20:16:28-07:00"
    }
  ]
}

GET /api/conversations/:conversation_id/activities/:id
get a specific activity item

Note: clients must only display activities/attachments with an objectType that they explicitly support. Future updates may add additional objectTypes and clients must ignore these until they add specific support.

Each objectType is defined by the activitystrea.ms schema: {activitystrea.ms/head/activity-schema.html#note Note}, {activitystrea.ms/head/activity-schema.html#image Image}, and {activitystrea.ms/head/activity-schema.html#collection Collection}

objectTypes of attachments are defined according to the activitystrea.ms schema: {activitystrea.ms/head/activity-schema.html#file File} and {activitystrea.ms/head/activity-schema.html#image Image}

Params

Param name Description
conversation_id
optional

referenced conversation


Value: Must be a Integer
id
optional

activity id to load


Value: Must be a Integer

Response Fields

activity[id] unique id for this activity Integer
activity[verb] type of activity (post, update, join, leave) String
activity[title] descriptive sentence of the activity String
activity[actor[displayName]] full name of the activity actor String
activity[actor[firstName]] first name of the activity actor String
activity[actor[image][url]] image url for the activity actor String
activity[object[objectType]] data type of the activity (note, image, collection) String
activity[object[shared_message]] shared Message referenced by this activity. Contains all Message response fields except likes, comments, shared_message Hash
activity[object[replied_to_id]] id for the message or comment that this activity is in response to Integer
activity[object[replied_to_type]] the type of object that this activity is a reply to, valid values are "SocialObject" and "Comment" String
activity[object[replied_to_message_id]] id for either the message that this activity was a reply to or the parent message of the comment that this activity was a reply to Integer
activity[object[replied_to]] the object that this activity is a reply to. Contains all Message or Comment response fields except likes and message comments Hash
activity[object[client_provided_guid]] the client-provided unique identifier for the object, if any String
activity[published] timestamp when the activity was created DateTime
activity[location[longitude]] location longitude of the activity Integer
activity[location[latitude]] location latitude of the activity Integer
activity[generator[name]] name of client application that generated the activity String
activity[generator[url]] informational url of the client application that generated the activity String
activity[attachments] array of objects associated to this object (image, file) Array
activity[target] target of the activity (ex: Joe joined the *conversation*) Object

Example Curl Commands

curl -X GET -v --basic -u "emily@socialcast.com:demo" https://demo.socialcast.com/api/conversations/2/activities/8.json

Examples

GET 
200
{
  "activity": {
    "id": 6,
    "verb": "post",
    "actor": {
      "id": 145,
      "displayName": "J'øhn133 D'øe131",
      "firstName": "J'øhn133",
      "image": {
        "height": 140,
        "width": 140,
        "url": "https://socialcast.socialcast.test/assets-test/v6/avatars/default_user_square140-7da7e1d98b33ef152280b1f653cfd80e2db24b01b625a72abc320673eea5af53.png",
        "is_system_default": true
      },
      "inactive": false,
      "terminated": false
    },
    "object": {
      "id": 4,
      "objectType": "note",
      "replied_to_id": 63,
      "replied_to_type": "SocialObject",
      "replied_to_message_id": 63,
      "replied_to": {
        "id": 63,
        "user": {
          "id": 147,
          "first_name": "J'øhn135",
          "last_name": "D'øe133",
          "name": "J'øhn135 D'øe133",
          "html_name": "J&#39;øhn135 D&#39;øe133",
          "url": "https://socialcast.socialcast.test/users/147-j%C3%B8hn135d%C3%B8e133",
          "avatars": {
            "is_system_default": true,
            "id": null,
            "square16": "https://socialcast.socialcast.test/assets-test/v6/avatars/default_user_square16-3b951350d61d203ece2fa5dd274fa7bd35275e132c17310d9006514f8839c857.png",
            "square30": "https://socialcast.socialcast.test/assets-test/v6/avatars/default_user_square30-6db66ac25c338d1e548a68465e2723ff63367c2aafbcc01db24c83964056b892.png",
            "square45": "https://socialcast.socialcast.test/assets-test/v6/avatars/default_user_square45-16865426333e244c59076d4f2475b711ed1ff9d12c97f4cf354f373a0170a1fd.png",
            "square70": "https://socialcast.socialcast.test/assets-test/v6/avatars/default_user_square70-1708999e8f1fea583408d7fc64b2177f853e4123bea2ffcf35f4839c8697e0ba.png",
            "square140": "https://socialcast.socialcast.test/assets-test/v6/avatars/default_user_square140-7da7e1d98b33ef152280b1f653cfd80e2db24b01b625a72abc320673eea5af53.png"
          },
          "username": "Jøhn135Døe133",
          "active": true,
          "terminated": false,
          "inactive": false,
          "role": "member",
          "type": "User",
          "title": null,
          "out_of_office": false,
          "out_of_office_on": null,
          "back_in_office_on": null,
          "company_login": null
        },
        "title": "",
        "body": "blørg & stuff 14",
        "html_body": "<div class=\"markdown-body\"><p>blørg &amp; stuff 14</p></div>",
        "action": "",
        "verb": null,
        "message_type": "status_message",
        "icon": null,
        "url": "https://socialcast.socialcast.test/api/messages/63",
        "permalink_url": "https://socialcast.socialcast.test/messages/63",
        "external_url": null,
        "created_at": "2017-04-23T03:16:28+00:00",
        "updated_at": "2017-04-23T03:16:28+00:00",
        "attachments": [],
        "media_files": [],
        "contains_url_only": null,
        "external_resources": [],
        "tags": [],
        "last_interacted_at": 1492917388,
        "group": {},
        "category_id": null,
        "recipients": [],
        "thumbnail_url": null,
        "player_url": null,
        "player_params": null,
        "likable": null,
        "ratable": false,
        "rating": null,
        "ratings_average": null,
        "ratings_count": null,
        "editable": null,
        "deletable": null,
        "watchable": false,
        "watch": null,
        "flag": null,
        "source": null,
        "poll": null,
        "embed": null,
        "hidden": null,
        "subscribed": null,
        "groups": [],
        "extensions": [],
        "new_group_id": null,
        "new_group_archived_at": null,
        "days_of_stickiness": 0,
        "sticky_for_current_user": false,
        "shareable": false,
        "share_count": 0,
        "client_provided_guid": null,
        "comments_count": 0,
        "comments": [],
        "likes": [],
        "likes_count": 0,
        "shared_message": null,
        "commentable": false
      },
      "client_provided_guid": null,
      "content": "testing & bläh & stuff 4",
      "html_body": "<div class=\"markdown-body\"><p>testing &amp; bläh &amp; stuff 4</p></div>",
      "shared_message": null
    },
    "title": "J'øhn133 D'øe131 sent a chat message",
    "published": "2017-04-22T20:16:28-07:00"
  }
}