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に置き換えてください。

過去1週間の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 | string | **必須。** Slackコンテンツを取得するために「slack」に設定します。 |
| from | string | GMT+0のISO 8601形式での開始時間。指定しない場合、デフォルトは現在時刻です。 |
| to | string | GMT+0のISO 8601形式での終了時間。指定しない場合、「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