채널 내 메시징
Get Channel Messages
GET
https://api.talkplus.io/v1.4/api/channels/:channelId/messages
Path Parameters
Name | Type | Description |
---|---|---|
channelId* | string |
Query Parameters
Name | Type | Description |
---|---|---|
limit | string | number of messages to fetch. Default: 20, max: 50 |
lastMessageId | integer | Last message ID to query from (use for pagination) |
order | string | 메시지 정렬 방식. default: latest latest: - lastMessageId 생략 : 최근 메시지 순서 - lastMessageId 사용 : lastMessageId 이전 내역 최신 메시지 순서 oldest: - lastMessageId 생략 : 오래된 메시지 순서 - lastMessageId 사용: lastMessageId 이후 내역 오래된 메시지 순서 |
Headers
Name | Type | Description |
---|---|---|
api-key* | string | App API key |
app-id* | string | App ID |
Get Channel Message
GET
https://api.talkplus.io/v1.4/api/channels/:channelId/messages/:messageId
Path Parameters
Name | Type | Description |
---|---|---|
channelId* | string | |
messageId* | string |
Headers
Name | Type | Description |
---|---|---|
api-key* | string | App API key |
app-id* | string | App ID |
Send Channel Message
POST
https://api.talkplus.io/v1.4/api/channels/:channelId/messages/send
채널에 메시지를 발송할 수 있습니다. 현재 지원하는 타입은 text, hidden, custom 타입입니다. - default 타입은 text 입니다 - hidden 타입 메시지 발송 시, push notification는 발송되지 않습니다. - admin 메시지 타입은 TalkPlus 대시보드 또는 REST API (/v1/api/channels/{channelId}/messages/admin/send)를 를 통해서만 발송이 가능합니다. - 메세지 텍스트의 허용된 최대 길이는 8192자입니다. - data의 경우, 최대 5개의 Key-value 형식의 데이터를 넣을 수 있습니다. - key값의 최대 길이는 128자이고, value값의 최대 길이는 1024자입니다. - key, value 둘 다 문자열이어야 합니다. - 메시지 텍스트와 data 둘 다 빈 값일 경우 발송에 실패합니다.
Path Parameters
Name | Type | Description |
---|---|---|
channelId* | string |
Headers
Name | Type | Description |
---|---|---|
content-type | string | application/json |
api-key* | string | App API key |
app-id* | string | App ID |
Request Body
Name | Type | Description |
---|---|---|
senderId* | string | 메시지 발송 사용자 ID |
type* | string | 메시지 타입 |
text | string | 메시지 텍스트 |
data | object | Custom metadata |
mentions | array | 멘션하고자 하는 사용자ID 목록 |
fileUrl | string | 파일 경로 직접 지정 |
translationTargetLanguages | array | 번역대상 언어 (대시보드에서 번역 기능 활성화 필요) |
Send File Message
POST
https://api.talkplus.io/v1.4/api/channels/:channelId/messages/send
파일 전송 시에는 Content-Type을 multipart/form-data로 보내야 합니다. 업로드 가능한 최대 파일 사이즈는 15MB입니다. 현재 지원하는 타입은 text, hidden, custom 타입입니다. - default 타입은 text 입니다 - hidden 타입 메시지 발송 시, push notification는 발송되지 않습니다. - admin 메시지 타입은 TalkPlus 대시보드 또는 REST API (/v1/api/channels/{channelId}/messages/admin/send)를 를 통해서만 발송이 가능합니다. 메세지 텍스트의 허용된 최대 길이는 8192자입니다. data의 경우, 최대 5개의 Key-value 형식의 데이터를 넣을 수 있습니다. - key값의 최대 길이는 128자이고, value값의 최대 길이는 1024자입니다. - key, value 둘 다 문자열이어야 합니다. - 메시지 텍스트와 data 둘 다 빈 값일 경우 발송에 실패합니다.
메시지 번역 기능은 구글 클라우드 번역 서비스를 통하여 지원됩니다. - 이 기능을 사용하려면 톡플러스 대쉬보드(TalkPlus Dashboard)에서 구글 클라우드 서비스 계정 KEY 를 추가하여 주십시오. - 번역 될 언어 코드 (IOS-639) 값을 translationTargetLanguages 파라미터에 입력하여 주십시오. - 사용할 수 있는 언어 코드 (IOS-639) 값은 아래 링크를 참조하여 주십시오. https://cloud.google.com/translate/docs/languages
Path Parameters
Name | Type | Description |
---|---|---|
channelId* | string |
Headers
Name | Type | Description |
---|---|---|
content-type* | string | must be "multipart/form-data" |
api-key* | string | App API Key |
app-id* | string | App ID |
Request Body
Name | Type | Description |
---|---|---|
senderId* | string | 메시지 발송 사용자 ID |
type* | string | 메시지 타입 |
text | string | 메시지 텍스트 |
data | string | Key-value 형식의 채널 메타 정보. JSON 포맷의 문자열 |
file* | string | 파일 |
file-content-type | string | 전송하는 파일의 content-type. 지정하지 않을 시, TalkPlus 서버에서 자동으로 지정 |
mentions | array | 멘션하고자 하는 사용자ID 목록 |
translationTargetLanguages | array | 번역대상 언어 (대시보드에서 번역 기능 활성화 필요) |
Send Channel Admin Message
POST
https://api.talkplus.io/v1.4/api/channels/:channelId/messages/admin/send
채널에 admin 메시지를 발송할 수 있습니다.
메시지 타입을 지정하지 않으면 기본적으로 admin
타입으로 발송됩니다. admin
타입과 달리 admin_hidden
타입으로 메세지를 보내게 되면, 채널에 참여중인 멤버들의 unreadCount
가 증가하지 않습니다. admin
, admin_hidden
메시지의 경우, 최초 앱 생성 시 자동 생성된 admin 사용자가 송신자로 지정되어 발송됩니다 (admin 사용자 정보는 대시보드에서 수정 가능합니다).
- 메세지 텍스트의 허용된 최대 길이는 8192자입니다.
- data의 경우, 최대 5개의 Key-value 형식의 데이터를 넣을 수 있습니다.
- key값의 최대 길이는 128자이고, value값의 최대 길이는 1024자입니다.
- key, value 둘 다 문자열이어야 합니다.
- 메시지 텍스트와 data 둘 다 빈 값일 경우 발송에 실패합니다.
Path Parameters
Name | Type | Description |
---|---|---|
channelId* | string |
Headers
Name | Type | Description |
---|---|---|
content-type | string | application/json |
api-key* | string | App API key |
app-id* | string | App ID |
Request Body
Name | Type | Description |
---|---|---|
text | string | 메시지 텍스트 |
data | object | Custom metadata |
mentions | array | 멘션하고자 하는 사용자ID 목록 |
disablePushNotification | bool | set this to true to disable push notification for this message |
type | string |
|
fileUrl | string | 파일 경로 직접 지정 |
translationTargetLanguages | array | 번역대상 언어 (대시보드에서 번역 기능 활성화 필요) |
Delete Channel Message
DELETE
https://api.talkplus.io/v1.4/api/channels/:channelId/messages/:messageId
Path Parameters
Name | Type | Description |
---|---|---|
channelId* | string | |
messageId* | string |
Headers
Name | Type | Description |
---|---|---|
content-type | string | application/json |
api-key* | string | App API key |
app-id* | string | App ID |
Request Body
Name | Type | Description |
---|---|---|
text | string | message text |
data | object | key-value data |
Last updated