Post direct message

Method

POST

URL

https://typetalk.com/api/v2/spaces/:spaceKey/messages/@:accountName 

Scope

topic.post

URL parameters

Name Type Description
spaceKey String Space key
accountName String Account name

Form parameters

Name Type Description
message String your message, (max 4000 characters)
replyTo (Optional) Number references Post ID
showLinkMeta (Optional) Boolean show OGP data of URL included in message. default value: true
fileKeys[0] … fileKeys[4] (Optional) String attachment file key (refer to Upload attachment file), maximum count: 5
talkIds[0] … talkIds[4] (Optional) Number Talk IDs that you want to put the message in, maximum count: 5
attachments[0].fileUrl … attachments[4].fileUrl (Optional) String Each message can have max. 5 file URLs (max. 10MB per file).
attachments[0].fileName … attachments[4].fileName (Optional) String Unless the parameter specifies otherwise, filenames are automatically generated from the file URL. (maximum count: 5)

Response Example

{
    "space": {
        "key": "xxxxxxxx",
        "name": "Awesome Tech Inc.",
        "enabled": true,
        "imageUrl": "https://apps.nulab-inc.com/spaces/xxxxxxxx/photo/large"
    },
    "topic": {
        "id": 3917,
        "name": "Jessica,StefHull",
        "suggestion": "Jessica,StefHull",
        "isDirectMessage": true,
        "lastPostedAt": "2018-11-26T01:09:12Z",
        "createdAt": "2016-07-06T02:51:03Z",
        "updatedAt": "2016-08-17T08:30:58Z",
        "description": ""
    },
    "post": {
        "id": 168196,
        "topicId": 3917,
        "replyTo": null,
        "message": "Sure!",
        "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-26T01:07:27Z"
        },
        "mention": null,
        "attachments": [],
        "likes": [],
        "talks": [],
        "links": [],
        "createdAt": "2018-11-26T01:09:12Z",
        "updatedAt": "2018-11-26T01:09:12Z"
    },
    "mentions": [],
    "exceedsAttachmentLimit": false,
    "directMessage": {
        "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-11-09T10:29:47Z"
        }
    }
}

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