检索 Slack 的内容

获取 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": {}
}

示例请求

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"

YOUR_JWT_TOKEN 替换为您的实际 JWT 令牌,并将 12345 替换为实际的讨论 ID。

获取过去一周的 Slack 内容

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" %}
将 `YOUR_JWT_TOKEN` 替换为您的实际 JWT 令牌,将 `12345` 替换为实际讨论 ID。
{% endhint %}
{% endtab %}
{% endtabs %}

## 路径参数

| 参数           | 类型    | 描述                                   |
|----------------|---------|----------------------------------------|
| discussion_id  | 整数    | **必填。** 要检索内容的 Slack 频道或讨论的 ID。 |

## 查询参数

| 参数 | 类型 | 描述 |
|-----------|------|-------------|
| integration_type | 字符串 | **必填。** 设置为 "slack" 以检索 Slack 内容。 |
| from | 字符串 | 以 ISO 8601 格式表示的起始时间,时区为 GMT+0。如果未指定,默认值为现在。 |
| to | 字符串 | 以 ISO 8601 格式表示的结束时间,时区为 GMT+0。如果未指定,则为 "from" 参数之前的 7 天。 |

## 响应格式

```json
{
  "discussion_content": "用户 A [2023-06-01 10:30:00]: 早上好,团队!\n用户 B [2023-06-01 10:32:15]: 早上好!大家今天过得怎么样?\n...",
  "thread_contents": {
    "2023-06-01T10:30:00Z": "用户 C [2023-06-01 10:35:00]: @用户 A 我很好,谢谢关心!\n用户 A [2023-06-01 10:37:30]: 很高兴听到这个 @用户 C!",
    "2023-06-02T14:15:22Z": "用户 D [2023-06-02 14:20:45]: 这是项目的更新...\n用户 B [2023-06-02 14:25:10]: 谢谢更新!"
  }
}

错误响应

状态码
描述

404

找不到讨论

500

服务器内部错误

此端点检索 Slack 频道或直接消息对话的内容。它返回主要频道消息(discussion_content)和线程回复(thread_contents)。数据按时间顺序组织,并包含用户信息,使理解对话的上下文变得容易。

时间范围参数允许您专注于特定时期,这对于回顾近期活动或历史讨论特别有用。

Last updated