Commentaires

L’objet commentaire représente les commentaires publiés sur les idées.

L’objet commentaire

{
  "id": "b0373e42-2ac9-4c5b-9dae-0e0be53f4320",
  "createdAt": "2025-03-07T13:22:12.557Z",
  "updatedAt": "2025-03-07T13:22:12.557Z",
  "text": "Hello World",
  "phase": {
    "name": "Grow",
    "kind": "GROW"
  },
  "sender": {
    "email": "test@test.com",
    "firstName": "Test"
  }
}

Champs

Champ

Type

Description

identifiant

string

L’identifiant unique du commentaire.

createdAt

ISODate

La date de création du commentaire.

updatedAt

ISODate

La date de la dernière mise à jour du commentaire.

texte

string

Le contenu du commentaire

phase

Phase

La phase dans laquelle le commentaire a été créé

expéditeur

Utilisateur

L’utilisateur qui a créé ce commentaire

Lister les commentaires d’une idée

curl -X GET "https://api.ideanote.io/v1/ideas/c469e730-043d-4bda-a3a0-5e029f56c027/comments?fields=id,text,sender.firstName" \
     -H "Content-Type: application/json" \
     -H "Authorization: Bearer <API Token>"
const result = await fetch("https://api.ideanote.io/v1/ideas/c469e730-043d-4bda-a3a0-5e029f56c027/comments?fields=id,text,sender.firstName", {
  method: "GET",
  headers: {
    "Content-Type": "application/json",
    "Authorization": "Bearer <API Token>",
  }
});

const comment = await result.json();
La commande ci-dessus renvoie du JSON structuré comme suit :
[
  {
    "sender": {}
  },
  {
    "sender": {}
  },
  {
    "sender": {}
  }
]

Ce point de terminaison répertorie tous les commentaires d’une idée.

Requête HTTP

GET /v1/ideas/:idea_id/comments

Paramètres de requête

Paramètre

Description

idea_id

L’ID de l’idée pour laquelle répertorier les commentaires

Obtenir le commentaire

curl -X GET "https://api.ideanote.io/v1/comments/b0373e42-2ac9-4c5b-9dae-0e0be53f4320?fields=id,text,sender.firstName" \
     -H "Content-Type: application/json" \
     -H "Authorization: Bearer <API Token>"
const result = await fetch("https://api.ideanote.io/v1/comments/b0373e42-2ac9-4c5b-9dae-0e0be53f4320?fields=id,text,sender.firstName", {
  method: "GET",
  headers: {
    "Content-Type": "application/json",
    "Authorization": "Bearer <API Token>",
  }
});

const comment = await result.json();
La commande ci-dessus renvoie un JSON structuré comme suit :
{
  "sender": {}
}

Ce point de terminaison récupère un commentaire spécifique.

Requête HTTP

GET /v1/comments/:comment_id

Paramètres de requête

Paramètre

Description

comment_id

L’identifiant du commentaire à récupérer

Mettre à jour le commentaire

curl -X PUT "https://api.ideanote.io/v1/comments/b0373e42-2ac9-4c5b-9dae-0e0be53f4320?fields=id,text,sender.firstName" \
     -H "Content-Type: application/json" \
     -H "Authorization: Bearer <API Token>" \
     -d '{"text":"This is an edited comment"}'
const result = await fetch("https://api.ideanote.io/v1/comments/b0373e42-2ac9-4c5b-9dae-0e0be53f4320?fields=id,text,sender.firstName", {
  method: "PUT",
  body: {
    "text": "This is an edited comment"
  },
  headers: {
    "Content-Type": "application/json",
    "Authorization": "Bearer <API Token>",
  }
});

const comment = await result.json();
La commande ci-dessus renvoie un JSON structuré comme suit :
{
  "sender": {}
}

Ce point de terminaison met à jour un commentaire spécifique.

Requête HTTP

PUT /v1/comments/:comment_id

Paramètres de requête

Paramètre

Description

comment_id

L’identifiant du commentaire à mettre à jour

Supprimer le commentaire

curl -X DELETE "https://api.ideanote.io/v1/comments/b0373e42-2ac9-4c5b-9dae-0e0be53f4320" \
     -H "Content-Type: application/json" \
     -H "Authorization: Bearer <API Token>"
const result = await fetch("https://api.ideanote.io/v1/comments/b0373e42-2ac9-4c5b-9dae-0e0be53f4320", {
  method: "DELETE",
  headers: {
    "Content-Type": "application/json",
    "Authorization": "Bearer <API Token>",
  }
});

Ce point de terminaison supprime un commentaire spécifique.

Requête HTTP

DELETE /v1/comments/:comment_id

Paramètres de requête

Paramètre

Description

comment_id

L’identifiant du commentaire à supprimer