생성/삭제
그룹 채널 메시지 생성
그룹 채널에 메시지를 전송할 수 있습니다. 메시지 전송은 텍스트/파일 전송으로 구분됩니다.
정보
참고! 메시지 전송의 경우, 전송 시점에 사용자가 대화방을 보고 있다고 가정하므로 해당 사용자의 읽기 영수증과 배달 영수증을 자동 갱신합니다.
POST /v1/group/channels/(channel_id)/messages
Parameters
| 속성 | 설명 | 유형 | 필수여부 | 
|---|---|---|---|
| channel_id | 채널 아이디 | String | O | 
텍스트 메시지
Request
| 속성 | 설명 | 유형 | 기본값 | 필수여부 | 
|---|---|---|---|---|
| type | 메시지 유형 ('text', 'file') | String | 'text' | O | 
| user_id | 메시지를 발신하는 사용자 아이디 | String | 없음 | O | 
| content | 메시지 내용 | String | 없음 | O | 
| meta | 메타 데이터. key는 소/대문자, 한글, _, - 만 사용할 수 있으며 100byte string 으로 제한됩니다. value는 200byte string 으로 제합됩니다. key-value set은 최대 10개까지 저장할 수 있습니다. | Object | 없음 | X | 
{
  "type": "text",
  "user_id": "string",
  "content": "string",
  "meta": {
    "age": "20",
    ...
  }
}
Response
201 success{
  "user": {
    "user_id": "User ID",
    "name": "User Name",
    "profile_url": "User Profile URL",
    "meta": {
      "key": "value",
      ...
    },
    "created_at": 1658977173917,
    "updated_at": 1658977173917
  },
  "type": "text",
  "content": "Content",
  "meta": {
    "key": "value",
    ...
  },
  "message_id": 141,
  "channel_id": "Channel ID",
  "created_at": 1659935161318,
  "updated_at": 1659935161318
}
파일 메시지
Contet-Type: multipart/form-data 으로 요청 할 수 있습니다.
'file' type으로 요청되어야 하며, meta를 같이 요청하는 경우 JSON 문자열로 요청해야 합니다.
Request
| 속성 | 설명 | 유형 | 기본값 | 필수여부 | 
|---|---|---|---|---|
| type | 메시지 유형 ('text', 'file'). 'file'로 요청해야 합니다. | String | 'text' | O | 
| user_id | 메시지를 발신하는 사용자 아이디 | String | 없음 | O | 
| file | 첨부 파일 | Binary | 없음 | O | 
| meta | JSON 문자열로 된 메타 데이터. key는 소/대문자, 한글, _, - 만 사용할 수 있으며 100byte string 으로 제한됩니다. value는 200byte string 으로 제합됩니다. key-value set은 최대 10개까지 저장할 수 있습니다. | String | 없음 | X | 
Content-Type: multipart/form-data; boundary=----unique boundary string
----unique boundary string
Content-Disposition: form-data; name="user_id"
user_1
----unique boundary string
Content-Disposition: form-data; name="file"; filename="sample.png"
Content-Type: image/png
(data)
----unique boundary string
Content-Disposition: form-data; name="type"
file
----unique boundary string
Content-Disposition: form-data; name="meta"
{"age":"20"}  # JSON string
----unique boundary string
Response
201 success{
  "user": {
    "user_id": "User ID",
    "name": "User Name",
    "profile_url": "User Profile URL",
    "meta": {
      "key": "value",
      ...
    }
    "created_at": 1658977173917,
    "updated_at": 1658977173917
  },
  "type": "text",
  "file": {
    "type": "image/jpeg",
    "name": "sample.png",
    "url": "https://example.com/sample.jpg",
    "size": 81167
  },
  "meta": {
    "key": "value",
    ...
  },
  "message_id": 141,
  "channel_id": "Channel ID",
  "created_at": 1659935161318,
  "updated_at": 1659935161318
}
그룹 채널 메시지 삭제
DELETE /v1/group/channels/(channel_id)/messages/(message_id)
Parameters
| 속성 | 설명 | 유형 | 필수여부 | 
|---|---|---|---|
| channel_id | 채널 아이디 | String | O | 
| message_id | 메시지 아이디 | String | O |