GET /api/messages/search

search for messages matching a phrase

Also see ContentFilters#index.

Success Response Code: 200

Params

Param name Description
q
optional

search term


Value: Must be a String
since
optional

retrieve messages since a given time (seconds from epoch in UTC)


Value: Must be a Integer
before
optional

retrieve messages before a given time (seconds from epoch in UTC)


Value: Must be a Integer
content_filter
optional

messages that are a certain type of content (e.g. “Photo”, “Attachment”). Expects the “key” value from a content filter response.


Value: Must be a String
tags
optional

limit response to only messages containing a given tag


Value: Must be an array of String
comments_limit
optional

limit the included comment api response details to the N most recent comments


Value: Must be a Integer
likes_limit
optional

limit the included message-like api response details to the N most relevant likes per message


Value: Must be a Integer
comment_likes_limit
optional

limit the included comment-like api response details to the N most relevant likes per comment


Value: Must be a Integer

Response Fields

message messages in the default stream Array<Message>
messages_next_page next page number for :messages. Null if next page would not have any results. Integer

Example Curl Commands

curl -X GET -v --basic -u "emily@socialcast.com:demo" "https://demo.socialcast.com/api/messages/search.json?q=widget"
curl -X GET -v --basic -u "emily@socialcast.com:demo" "https://demo.socialcast.com/api/messages/search.json?q=widget&since=1306425150"
#obtain a list of content filter keys such as "photo"
curl -X GET -v --basic -u "emily@socialcast.com:demo" "https://demo.socialcast.com/api/content_filters.json"
#retrieve messages containing the word "link" which have been tagged with "sales"
curl -X GET -v --basic -u"emily@socialcast.com:demo" "https://demo.socialcast.com/api/messages/search.json?q=link&tags\[\]=sales"
curl -X GET -v --basic -u "emily@socialcast.com:demo" "https://demo.socialcast.com/api/messages/search?q=widget&content_filter=photo"

Examples

GET /api/messages/search.json
200
{
  "messages": [
    {
      "id": 3,
      "user": {
        "id": 21,
        "first_name": "J'øhn19",
        "last_name": "D'øe19",
        "name": "J'øhn19 D'øe19",
        "html_name": "J&#39;øhn19 D&#39;øe19",
        "url": "https://socialcast.socialcast.test/users/21-j%C3%B8hn19d%C3%B8e19",
        "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øhn19Døe19",
        "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": "quux **bold**",
      "html_body": "<div class=\"markdown-body\"><p>quux <strong>bold</strong></p></div>",
      "action": "",
      "verb": null,
      "message_type": "status_message",
      "icon": null,
      "url": "https://socialcast.socialcast.test/api/messages/3",
      "permalink_url": "https://socialcast.socialcast.test/messages/3",
      "external_url": null,
      "created_at": "2017-09-20T23:16:38+00:00",
      "updated_at": "2017-09-20T23:16:38+00:00",
      "attachments": [],
      "media_files": [],
      "contains_url_only": null,
      "external_resources": [],
      "tags": [],
      "last_interacted_at": 1505949398,
      "group": {},
      "category_id": null,
      "recipients": [],
      "thumbnail_url": null,
      "player_url": null,
      "player_params": null,
      "likable": false,
      "ratable": false,
      "rating": null,
      "ratings_average": null,
      "ratings_count": null,
      "editable": true,
      "deletable": true,
      "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": true
    }
  ],
  "messages_next_page": null
}