Contents

Search messages

Search messages by various criteria.

Method

GET

URL

https://typetalk.com/api/v2/search/posts

Scope

topic.read

Query parameters

NameTypeDescription
qStringKeyword to search
spaceKeyStringSpace key
topicIds (Optional)NumberTopic ID
hasAttachments (Optional)BooleanSearch only posts with attachments. default value: false
accountIds (Optional)NumberAccount ID
start (Optional)NumberStart position for searching posts.
from (Optional)DateTimeStart date for searching posts.
to (Optional)DateTimeEnd date for searching posts.
botExclusion (Optional)BooleanExclude bot posts from search results. default value: false

Response Example

{
    "count": 32,
    "posts": [
        {
            "id": 11842896,
            "topicId": 53692,
            "topic": {
                "id": 53692,
                "name": "Awesome project",
                "suggestion": "Awesome project",
                "isDirectMessage": false,
                "lastPostedAt": "2017-10-12T06:20:40Z",
                "createdAt": "2017-09-27T09:43:29Z",
                "updatedAt": "2017-10-12T06:22:28Z"
            },
            "replyTo": null,
            "message": "It is sunny today.",
            "account": {
                "id": 50117,
                "name": "Michael",
                "fullName": "Michael Buck",
                "suggestion": "Michael Buck",
                "imageUrl": "https://typetalk.com/accounts/50117/profile_image.png?t=1504408579564",
                "isBot": false,
                "createdAt": "2017-09-01T01:55:05Z",
                "updatedAt": "2017-10-12T07:15:40Z"
            },
            "attachments": [],
            "links": [],
            "directMessage": null,
            "createdAt": "2017-10-12T06:20:20Z",
            "updatedAt": "2017-10-12T06:20:20Z"
        }
    ],
    "isLimited": false
}

All responses are formatted in JSON and include an ETag. If you call an API with an If-None-Match header, the server will return a 304 status code if the data is unchanged. The date and time format is ISO 8601, and the timezone is UTC (eg. 2014-01-09T06:20:08Z).