Get topic messages

Method

GET

URL

https://typetalk.com/api/v1/topics/:topicId

Scope

topic.read

URL parameters

Name Type Description
topicId Number Topic ID

Query parameters

Name Type Description
count (Optional) Number default value: 20, maximum: 200
from (Optional) Number references Post ID
direction (Optional) String “backward” or “forward”

Response Example

{
    "mySpace": {
        "space": {
            "key": "xxxxx",
            "name": "Awesome Tech Inc.",
            "enabled": true,
            "imageUrl": "https://apps.nulab-inc.com/spaces/xxxxx/photo/large"
        },
        "myRole": "ADMIN",
        "isPaymentAdmin": true,
        "invitableRoles": [
            "ADMIN",
            "USER",
            "GUEST"
        ],
        "myPlan": {
            "plan": {
                "key": "typetalk.standard10",
                "name": "Standard 10 Users",
                "limitNumberOfUsers": 10,
                "limitNumberOfAllowedAddresses": 10,
                "limitTotalAttachmentSize": 10737418240
            },
            "enabled": true,
            "trial": null,
            "numberOfUsers": 4,
            "numberOfAllowedAddresses": 0,
            "totalAttachmentSize": 14356,
            "createdAt": "2016-01-27T09:37:27Z",
            "updatedAt": "2018-09-25T09:43:56Z"
        }
    },
    "team": null,
    "topic": {
        "id": 4829,
        "name": "Coffee shop",
        "suggestion": "Coffee shop",
        "isDirectMessage": false,
        "lastPostedAt": "2018-09-28T20:23:57Z",
        "createdAt": "2017-11-13T22:27:21Z",
        "updatedAt": "2017-12-21T02:41:00Z",
        "description": "A topic for getting off-topic"
    },
    "favorite": true,
    "bookmark": {
        "postId": 167419,
        "updatedAt": "2018-10-01T01:26:26Z"
    },
    "posts": [
        {
            "id": 160928,
            "topicId": 4829,
            "replyTo": null,
            "message": "In case you hadn't realized https://media.giphy.com/media/3oEjHKjVoNVsCeMoDe/giphy.gif",
            "account": {
                "id": 2499,
                "name": "Moss",
                "fullName": "Moss",
                "suggestion": "Moss",
                "imageUrl": "https://typetalk.com/accounts/2499/profile_image.png?t=1453891379196",
                "isBot": false,
                "createdAt": "2016-01-27T09:55:23Z",
                "updatedAt": "2018-08-18T01:42:19Z"
            },
            "mention": null,
            "attachments": [],
            "likes": [],
            "talks": [],
            "links": [
                {
                    "id": 3548,
                    "url": "https://media.giphy.com/media/3oEjHKjVoNVsCeMoDe/giphy.gif",
                    "contentType": "text/html",
                    "title": "Its Friday GIF by Justin - Find & Share on GIPHY",
                    "description": "Discover & share this Justin GIF with everyone you know. GIPHY is how you search, share, discover, and create GIFs.",
                    "imageUrl": "https://media.giphy.com/media/3oEjHKjVoNVsCeMoDe/giphy.gif",
                    "embed": {
                        "width": 480,
                        "author_url": "https://giphy.com/justin",
                        "title": "Its Friday GIF by Justin - Find & Share on GIPHY",
                        "url": "https://media.giphy.com/media/3oEjHKjVoNVsCeMoDe/giphy.gif",
                        "type": "photo",
                        "provider_name": "GIPHY",
                        "provider_url": "https://giphy.com/",
                        "author_name": "Justin",
                        "height": 371
                    },
                    "createdAt": "2017-11-13T22:24:01Z",
                    "updatedAt": "2018-08-18T02:32:28Z"
                }
            ],
            "createdAt": "2017-11-13T22:29:03Z",
            "updatedAt": "2017-11-13T22:29:03Z"
        },
        {
            "id": 160929,
            "topicId": 4829,
            "replyTo": 160928,
            "message": "https://media.giphy.com/media/111WSGoF53XKq4/giphy.gif",
            "account": {
                "id": 2500,
                "name": "Jessica",
                "fullName": "Jessica",
                "suggestion": "Jessica",
                "imageUrl": "https://typetalk.com/accounts/2500/profile_image.png?t=1454061730873",
                "isBot": false,
                "createdAt": "2016-01-27T09:55:35Z",
                "updatedAt": "2018-11-06T03:33:00Z"
            },
            "mention": null,
            "attachments": [],
            "likes": [
                {
                    "id": 19551,
                    "postId": 160929,
                    "topicId": 4829,
                    "comment": "",
                    "account": {
                        "id": 2498,
                        "name": "Stefanie",
                        "fullName": "Stefanie",
                        "suggestion": "Stefanie",
                        "imageUrl": "https://typetalk.com/accounts/2498/profile_image.png?t=1453891479138",
                        "isBot": false,
                        "createdAt": "2016-01-27T09:55:09Z",
                        "updatedAt": "2018-08-18T01:42:19Z"
                    },
                    "createdAt": "2017-12-06T06:22:11Z"
                },
                {
                    "id": 19747,
                    "postId": 160929,
                    "topicId": 4829,
                    "comment": "",
                    "account": {
                        "id": 2499,
                        "name": "Moss",
                        "fullName": "Moss",
                        "suggestion": "Moss",
                        "imageUrl": "https://typetalk.com/accounts/2499/profile_image.png?t=1453891379196",
                        "isBot": false,
                        "createdAt": "2016-01-27T09:55:23Z",
                        "updatedAt": "2018-08-18T01:42:19Z"
                    },
                    "createdAt": "2018-02-16T08:59:30Z"
                }
            ],
            "talks": [],
            "links": [
                {
                    "id": 3549,
                    "url": "https://media.giphy.com/media/111WSGoF53XKq4/giphy.gif",
                    "contentType": "text/html",
                    "title": "Christina Aguilera Television GIF by The Voice - Find & Share on GIPHY",
                    "description": "The official GIPHY channel for #TheVoice, Mondays and Tuesdays at 8/7c on NBC!",
                    "imageUrl": "https://media.giphy.com/media/111WSGoF53XKq4/giphy.gif",
                    "embed": {
                        "width": 500,
                        "author_url": "https://giphy.com/thevoice",
                        "title": "Christina Aguilera Television GIF by The Voice - Find & Share on GIPHY",
                        "url": "https://media.giphy.com/media/111WSGoF53XKq4/giphy.gif",
                        "type": "photo",
                        "provider_name": "GIPHY",
                        "provider_url": "https://giphy.com/",
                        "author_name": "The Voice",
                        "height": 281
                    },
                    "createdAt": "2017-11-13T22:29:52Z",
                    "updatedAt": "2018-08-18T02:46:05Z"
                }
            ],
            "createdAt": "2017-11-13T22:29:51Z",
            "updatedAt": "2017-11-13T22:29:51Z"
        },
        {
            "id": 160930,
            "topicId": 4829,
            "replyTo": null,
            "message": "@all I made a few too many batches of chocolate chip cookies last night (a travesty, I know!), so I brought some in to share. They're in the kitchen! :cookie: :cookie: :cookie: :cookie: :cookie: ",
            "account": {
                "id": 2498,
                "name": "Stefanie",
                "fullName": "Stefanie",
                "suggestion": "Stefanie",
                "imageUrl": "https://typetalk.com/accounts/2498/profile_image.png?t=1453891479138",
                "isBot": false,
                "createdAt": "2016-01-27T09:55:09Z",
                "updatedAt": "2018-08-18T01:42:19Z"
            },
            "mention": {
                "id": 16415,
                "readAt": "2017-11-14T07:36:56Z"
            },
            "attachments": [],
            "likes": [],
            "talks": [
                {
                    "id": 2172,
                    "topicId": 4829,
                    "name": "FOOD",
                    "suggestion": "FOOD",
                    "createdAt": "2017-11-13T22:38:14Z",
                    "updatedAt": "2017-11-13T22:38:14Z",
                    "backlog": null
                }
            ],
            "links": [],
            "createdAt": "2017-11-13T22:32:27Z",
            "updatedAt": "2017-11-13T22:32:27Z"
        },
        {
            "id": 160931,
            "topicId": 4829,
            "replyTo": 160930,
            "message": "@Stefanie :dizzy: thank you for making my dreams come true https://media.giphy.com/media/bAlYQOugzX9sY/giphy.gif",
            "account": {
                "id": 2497,
                "name": "Will",
                "fullName": "Will",
                "suggestion": "Will",
                "imageUrl": "https://typetalk.com/accounts/2497/profile_image.png?t=1510596200433",
                "isBot": false,
                "createdAt": "2016-01-27T09:54:48Z",
                "updatedAt": "2018-09-28T20:22:05Z"
            },
            "mention": null,
            "attachments": [],
            "likes": [],
            "talks": [
                {
                    "id": 2172,
                    "topicId": 4829,
                    "name": "FOOD",
                    "suggestion": "FOOD",
                    "createdAt": "2017-11-13T22:38:14Z",
                    "updatedAt": "2017-11-13T22:38:14Z",
                    "backlog": null
                }
            ],
            "links": [
                {
                    "id": 3550,
                    "url": "https://media.giphy.com/media/bAlYQOugzX9sY/giphy.gif",
                    "contentType": "text/html",
                    "title": "Cookie Monster GIF - Find & Share on GIPHY",
                    "description": "Discover & share this Cookie Monster GIF with everyone you know. GIPHY is how you search, share, discover, and create GIFs.",
                    "imageUrl": "https://media.giphy.com/media/bAlYQOugzX9sY/200.gif",
                    "embed": {
                        "width": 320,
                        "author_url": "https://giphy.com/",
                        "title": "Cookie Monster GIF - Find & Share on GIPHY",
                        "url": "https://media.giphy.com/media/bAlYQOugzX9sY/giphy.gif",
                        "type": "photo",
                        "provider_name": "GIPHY",
                        "provider_url": "https://giphy.com/",
                        "author_name": "GIPHY",
                        "height": 180
                    },
                    "createdAt": "2017-11-13T22:35:19Z",
                    "updatedAt": "2018-08-18T02:49:34Z"
                }
            ],
            "createdAt": "2017-11-13T22:35:18Z",
            "updatedAt": "2017-11-13T22:35:18Z"
        },
        {
            "id": 164018,
            "topicId": 4483,
            "replyTo": null,
            "message": "How about this wallpaper?",
            "account": {
                "id": 2500,
                "name": "Jessica",
                "fullName": "Jessica",
                "suggestion": "Jessica",
                "imageUrl": "https://typetalk.com/accounts/2500/profile_image.png?t=1454061730873",
                "isBot": false,
                "createdAt": "2016-01-27T09:55:35Z",
                "updatedAt": "2018-11-06T03:33:00Z"
            },
            "mention": null,
            "attachments": [
                {
                    "attachment": {
                        "contentType": "image/jpeg",
                        "fileKey": "c5082a1da3e99ecc97b8e5119781ac2b82e18dfa",
                        "fileName": "wallpaper.jpg",
                        "fileSize": 14356
                    },
                    "webUrl": "https://typetalk.com/topics/4483/posts/164018/attachments/1/wallpaper.jpg",
                    "apiUrl": "https://typetalk.com/api/v1/topics/4483/posts/164018/attachments/1/wallpaper.jpg",
                    "thumbnails": [
                        {
                            "type": "small",
                            "fileSize": 14356,
                            "width": 198,
                            "height": 125
                        },
                        {
                            "type": "medium",
                            "fileSize": 14356,
                            "width": 198,
                            "height": 125
                        },
                        {
                            "type": "large",
                            "fileSize": 14356,
                            "width": 198,
                            "height": 125
                        }
                    ]
                }
            ],
            "likes": [],
            "talks": [],
            "links": [],
            "createdAt": "2018-04-18T06:56:37Z",
            "updatedAt": "2018-04-18T06:56:37Z"
        }
    ],
    "hasNext": false,
    "exceedsAttachmentLimit": false,
    "onboarding": null,
    "isPostEnabled": true,
    "myTopic": null
}

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).