Lấy nội dung của Slack

Lấy nội dung của Slack

Retrieve the contents of a discussion by ID. A discussion can be a Slack or Discord chat.

get

Returns the content of the discussion with the specified ID. A discussion can be a Slack or Discord chat. The response contains two fields: discussion_content, which includes the main messages of the chat, and thread_contents, which contains the threads of the discussion.

Path parameters
discussion_idintegerRequired

The ID of the discussion to retrieve contents for. Discussions are either Slack or Discord chats.

Query parameters
integration_typestringRequired

Indicate the integration of the discussion. Currently, it can only be "slack" or "discord".

fromstringOptional

Indicate the starting time when we want to retrieve the content of the discussion in ISO 8601 format at GMT+0. If not specified, the default time is now.

tostringOptional

Indicate the ending time when we want to retrieve the content of the discussion in ISO 8601 format at GMT+0. If not specified, it is 7 days before the "from" parameter.

Responses
200

Main and threaded messages of the discussion in a time range.

application/json
get
/discussions/{discussion_id}/contents/

Ví dụ Yêu cầu

Thay thế YOUR_JWT_TOKEN bằng mã thông báo JWT thực tế của bạn và 12345 bằng ID cuộc thảo luận thực tế.

Lấy nội dung Slack trong tuần qua

to_date = datetime.now().isoformat() + "Z" from_date = (datetime.now() - timedelta(days=7)).isoformat() + "Z"

get_slack_contents(12345, from_date, to_date)

Phản hồi lỗi

Mã trạng thái
Mô tả

404

Không tìm thấy cuộc thảo luận

500

Lỗi máy chủ nội bộ

Điểm cuối này truy xuất nội dung của một kênh Slack hoặc cuộc trò chuyện tin nhắn trực tiếp. Nó trả về cả tin nhắn chính của kênh (discussion_content) và các phản hồi theo chủ đề (thread_contents). Dữ liệu được tổ chức theo thứ tự thời gian và bao gồm thông tin người dùng, giúp dễ dàng hiểu ngữ cảnh của các cuộc trò chuyện.

Các tham số khoảng thời gian cho phép bạn tập trung vào các khoảng thời gian cụ thể, điều này đặc biệt hữu ích cho việc xem xét hoạt động gần đây hoặc các cuộc thảo luận lịch sử.

Last updated