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/
GET /api/v1/discussions/{discussion_id}/contents/?integration_type=text HTTP/1.1
Host: api.rememberizer.ai
Accept: */*
{
  "discussion_content": "",
  "thread_contents": {}
}

Ví dụ Yêu cầu

curl -X GET \
  "https://api.rememberizer.ai/api/v1/discussions/12345/contents/?integration_type=slack&from=2023-06-01T00:00:00Z&to=2023-06-07T23:59:59Z" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"

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)


{% hint style="info" %}
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ế.
{% endhint %}
{% endtab %}
{% endtabs %}

## Tham số Đường dẫn

| Tham số | Loại | Mô tả |
|---------|------|-------|
| discussion_id | số nguyên | **Bắt buộc.** ID của kênh Slack hoặc cuộc thảo luận để lấy nội dung. |

## Tham số truy vấn

| Tham số | Loại | Mô tả |
|---------|------|-------|
| integration_type | chuỗi | **Bắt buộc.** Đặt thành "slack" để lấy nội dung từ Slack. |
| from | chuỗi | Thời gian bắt đầu theo định dạng ISO 8601 tại GMT+0. Nếu không được chỉ định, mặc định là bây giờ. |
| to | chuỗi | Thời gian kết thúc theo định dạng ISO 8601 tại GMT+0. Nếu không được chỉ định, nó là 7 ngày trước tham số "from". |

## Định dạng Phản hồi

```json
{
  "discussion_content": "Người dùng A [2023-06-01 10:30:00]: Chào buổi sáng đội ngũ!\nNgười dùng B [2023-06-01 10:32:15]: Buổi sáng! Mọi người hôm nay thế nào?",
  "thread_contents": {
    "2023-06-01T10:30:00Z": "Người dùng C [2023-06-01 10:35:00]: @Người dùng A Mình khỏe, cảm ơn vì đã hỏi!\nNgười dùng A [2023-06-01 10:37:30]: Rất vui khi nghe điều đó @Người dùng C!",
    "2023-06-02T14:15:22Z": "Người dùng D [2023-06-02 14:20:45]: Đây là cập nhật về dự án...\nNgười dùng B [2023-06-02 14:25:10]: Cảm ơn vì đã cập nhật!"
  }
}

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