# API에서 공개 채팅 채널 콘텐츠 읽기

**URL:** https://meta.discourse.org/t/read-public-chat-channel-content-from-api/296218
**Category:** Development
**Tags:** chat, rest-api
**Created:** [2월 21, 2024, 7:10오후 UTC](https://meta.discourse.org/t/read-public-chat-channel-content-from-api/296218 "2024-02-21T19:10:24Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Leo\_Wong](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/leo_wong/32/286938_2.png) [@Leo\_Wong](https://meta.discourse.org/u/Leo_Wong)
#### Post date: [2월 21, 2024, 7:10오후 UTC](https://meta.discourse.org/t/read-public-chat-channel-content-from-api/296218/1 "2024-02-21T19:10:24Z")

</div>

안녕하세요, API를 통해 채팅 채널에 접근하는 방법을 설명하는 문서가 있을까요? 감사합니다.

---

<div class="post-metadata">

### Author: ![Fairies-Feast](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fairies-feast/32/363587_2.png) [@Fairies-Feast](https://meta.discourse.org/u/Fairies-Feast)
#### Post date: [2월 22, 2024, 3:12오전 UTC](https://meta.discourse.org/t/read-public-chat-channel-content-from-api/296218/3 "2024-02-22T03:12:51Z")

</div>

[이 주제](https://meta.discourse.org/t/how-do-you-get-a-singular-message-from-the-chat/277506)를 참고해 보세요.

---

<div class="post-metadata">

### Author: ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)
#### Post date: [2월 22, 2024, 1:30오후 UTC](https://meta.discourse.org/t/read-public-chat-channel-content-from-api/296218/5 "2024-02-22T13:30:08Z")

</div>

채팅 ATM에 대한 공식 API 문서가 없습니다.

채널 정보를 가져오려면 다음 엔드포인트를 사용하세요: `/chat/api/channels/:id.json`

메시지에 액세스하려면 다음 엔드포인트를 사용하세요: `/chat/api/channels/:id/messages.json`  
사용 가능한 파라미터는 다음과 같습니다:

```plaintext
fetch_from_last_read=true
page_size=10
target_message_id=23323
direction=past/future

```

---

<div class="post-metadata">

### Author: ![jwilkey](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jwilkey/32/303698_2.png) [@jwilkey](https://meta.discourse.org/u/jwilkey)
#### Post date: [3월 11, 2024, 9:29오후 UTC](https://meta.discourse.org/t/read-public-chat-channel-content-from-api/296218/6 "2024-03-11T21:29:14Z")

</div>

특정 사용자로 동적 채널에 POST 요청을 보낼 수 있나요? 웹훅 구성을 확인해 보았지만, 시스템 사용자로서 단일 기존 채널에만 작동하는 것 같습니다.

저는 인스턴스를 플랫폼의 커뮤니티 기능 백엔드로 사용 중이며, 짧은 형식의 커뮤니케이션을 허용하기 위해 토픽 길이와 전송 제한을 설정하는 것보다 채팅을 활용하는 것이 더 적합해 보이므로 이에 관심이 있습니다.

---

<div class="post-metadata">

### Author: ![jwilkey](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jwilkey/32/303698_2.png) [@jwilkey](https://meta.discourse.org/u/jwilkey)
#### Post date: [3월 11, 2024, 9:38오후 UTC](https://meta.discourse.org/t/read-public-chat-channel-content-from-api/296218/7 "2024-03-11T21:38:35Z")

</div>

조금 일찍 타이핑했네요. 알아냈는데, 이건 "비공식"인 것 같습니다.

```plaintext
curl --location 'https://MY_DISCOURSE.com/chat/4.json' \
--header 'Content-Type: application/json' \
--header 'Api-Key: THE_KEY' \
--header 'Api-Username: THE_ACTING_USER' \
--data '{ "message": "My great chat message!"}'

```
