Récupérer le contenu de Slack
Récupérer le contenu de Slack
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.
The ID of the discussion to retrieve contents for. Discussions are either Slack or Discord chats.
Indicate the integration of the discussion. Currently, it can only be "slack" or "discord".
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.
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.
Main and threaded messages of the discussion in a time range.
Discussion not found.
Internal server error.
GET /api/v1/discussions/{discussion_id}/contents/?integration_type=text HTTP/1.1
Host: api.rememberizer.ai
Accept: */*
{
"discussion_content": "",
"thread_contents": {}
}Exemples de Requêtes
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"const getSlackContents = async (discussionId, from = null, to = null) => {
const url = new URL(`https://api.rememberizer.ai/api/v1/discussions/${discussionId}/contents/`);
url.searchParams.append('integration_type', 'slack');
if (from) {
url.searchParams.append('from', from);
}
if (to) {
url.searchParams.append('to', to);
}
const response = await fetch(url.toString(), {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_JWT_TOKEN'
}
});
const data = await response.json();
console.log(data);
};
// Obtenir le contenu Slack de la semaine dernière
const toDate = new Date().toISOString();
const fromDate = new Date();
fromDate.setDate(fromDate.getDate() - 7);
const fromDateStr = fromDate.toISOString();
getSlackContents(12345, fromDateStr, toDate);import requests
from datetime import datetime, timedelta
def get_slack_contents(discussion_id, from_date=None, to_date=None):
headers = {
"Authorization": "Bearer YOUR_JWT_TOKEN"
}
params = {
"integration_type": "slack"
}
if from_date:
params["from"] = from_date
if to_date:
params["to"] = to_date
response = requests.get(
f"https://api.rememberizer.ai/api/v1/discussions/{discussion_id}/contents/",
headers=headers,
params=params
)
data = response.json()
print(data)Obtenez le contenu Slack de la semaine dernière
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" %}
Remplacez `YOUR_JWT_TOKEN` par votre véritable jeton JWT et `12345` par un ID de discussion réel.
{% endhint %}
{% endtab %}
{% endtabs %}
## Paramètres de chemin
| Paramètre | Type | Description |
|----------------|---------|-----------------------------------------------------------------------------|
| discussion_id | entier | **Requis.** L'ID du canal Slack ou de la discussion pour récupérer le contenu. |
## Paramètres de requête
| Paramètre | Type | Description |
|-----------|------|-------------|
| integration_type | string | **Requis.** Défini sur "slack" pour récupérer le contenu Slack. |
| from | string | Heure de début au format ISO 8601 à GMT+0. Si non spécifié, la valeur par défaut est maintenant. |
| to | string | Heure de fin au format ISO 8601 à GMT+0. Si non spécifié, c'est 7 jours avant le paramètre "from". |
## Format de Réponse
```json
{
"discussion_content": "Utilisateur A [2023-06-01 10:30:00]: Bonjour l'équipe!\nUtilisateur B [2023-06-01 10:32:15]: Bonjour! Comment ça va tout le monde aujourd'hui?\n...",
"thread_contents": {
"2023-06-01T10:30:00Z": "Utilisateur C [2023-06-01 10:35:00]: @Utilisateur A Je vais très bien, merci de demander!\nUtilisateur A [2023-06-01 10:37:30]: Content d'entendre ça @Utilisateur C!",
"2023-06-02T14:15:22Z": "Utilisateur D [2023-06-02 14:20:45]: Voici la mise à jour sur le projet...\nUtilisateur B [2023-06-02 14:25:10]: Merci pour la mise à jour!"
}
}Réponses d'erreur
404
Discussion non trouvée
500
Erreur interne du serveur
Ce point de terminaison récupère le contenu d'un canal Slack ou d'une conversation de message direct. Il renvoie à la fois les messages principaux du canal (discussion_content) et les réponses en fil (thread_contents). Les données sont organisées chronologiquement et incluent des informations sur les utilisateurs, ce qui facilite la compréhension du contexte des conversations.
Les paramètres de plage horaire vous permettent de vous concentrer sur des périodes spécifiques, ce qui est particulièrement utile pour examiner l'activité récente ou les discussions historiques.
Last updated