FastComments.com

FastComments JavaScript/TypeScript SDK


Ceci est le SDK officiel JavaScript/TypeScript pour FastComments.

SDK officiel JavaScript/TypeScript pour l'API FastComments

Dépôt

Voir sur GitHub


Installation Internal Link

npm install fastcomments-sdk

Documentation de l'API Internal Link


Référence complète de l’API : docs/api/README.md

Compatibilité navigateur vs serveur Internal Link


Ce SDK utilise des points d'entrée doubles pour garantir une compatibilité optimale et éviter les erreurs d'exécution :

  • fastcomments-sdk/browser - Version adaptée au navigateur utilisant fetch natif
  • fastcomments-sdk/server - Version complète pour Node.js avec prise en charge du SSO
  • fastcomments-sdk (par défaut) - Contient uniquement des types, sûr à importer n'importe où

API publiques vs sécurisées Internal Link

Le SDK fournit trois classes d'API principales :

  • DefaultApi - Points de terminaison sécurisés qui nécessitent votre clé API pour l'authentification. Utilisez-les pour les opérations côté serveur.
  • PublicApi - Points de terminaison publics accessibles sans clé API. Ils peuvent être appelés directement depuis les navigateurs/appareils mobiles/etc.
  • HiddenApi - Points de terminaison internes/admin destinés aux cas d'utilisation avancés.

Exemple : Utilisation de Public API (adaptée au navigateur)

import { PublicApi } from 'fastcomments-sdk/browser';

const publicApi = new PublicApi();

// Récupérer les commentaires d'une page (aucune clé API requise)
const response = await publicApi.getCommentsPublic({
  tenantId: 'your-tenant-id',
  urlId: 'page-url-id'
});

Exemple : Utilisation de Default API (uniquement côté serveur)

import { DefaultApi, Configuration } from 'fastcomments-sdk/server';

const config = new Configuration({
  apiKey: 'your-api-key' // Gardez cette clé secrète !
});
const defaultApi = new DefaultApi(config);

// Récupérer les commentaires avec un accès administrateur complet
const response = await defaultApi.getComments({
  tenantId: 'your-tenant-id',
  urlId: 'page-url-id'
});

Intégration SSO (authentification unique) Internal Link

FastComments prend en charge le SSO pour s'intégrer à votre système d'authentification utilisateur existant. La fonctionnalité SSO n'est disponible que dans l'export serveur car elle requiert les fonctionnalités crypto de Node.js.

SSO simple (côté serveur uniquement)

Le SSO simple doit être généré côté serveur et envoyé au client :

// Code côté serveur (Node.js/back-end)
import { FastCommentsSSO, PublicApi } from 'fastcomments-sdk/server';

// Crée un SSO simple en utilisant l'assistant intégré  
const userData = {
  username: 'john_doe',
  email: 'john@example.com',
  displayName: 'John Doe',
  avatar: 'https://example.com/avatar.jpg'
};

const sso = FastCommentsSSO.createSimple(userData, {
  loginURL: '/login',
  logoutURL: '/logout'
});

const ssoToken = sso.createToken();

// Envoyez ssoToken à votre code côté client
// Le code côté client peut ensuite utiliser ce jeton avec le SDK pour navigateur

SSO sécurisé (côté serveur, recommandé)

Le SSO sécurisé doit être implémenté côté serveur et offre une meilleure sécurité :

// Code côté serveur (Node.js/back-end)
import { FastCommentsSSO, PublicApi } from 'fastcomments-sdk/server';

// Crée un SSO sécurisé en utilisant l'assistant intégré
const userData = {
  id: 'user-123',
  email: 'john@example.com',
  username: 'john_doe',
  displayName: 'John Doe',
  avatar: 'https://example.com/avatar.jpg',
  isAdmin: false,
  isModerator: false
};

const sso = FastCommentsSSO.createSecure('your-api-key', userData, {
  loginURL: '/login',
  logoutURL: '/logout'
});

const ssoConfig = sso.prepareToSend();

// À utiliser avec des appels d'API côté serveur
const publicApi = new PublicApi();
const response = await publicApi.getCommentsPublic({
  tenantId: 'your-tenant-id',
  urlId: 'page-url-id',
  sso: JSON.stringify(ssoConfig)
});

// Ou envoyez ssoConfig au client pour une utilisation dans le navigateur

Utiliser le SSO depuis le navigateur (avec un jeton généré par le serveur)

// Code côté client (navigateur)
import { PublicApi } from 'fastcomments-sdk/browser';

// Récupérez le jeton SSO depuis votre point de terminaison serveur
const ssoToken = await fetch('/api/sso-token').then(r => r.json());

const publicApi = new PublicApi();
const response = await publicApi.getCommentsPublic({
  tenantId: 'your-tenant-id',
  urlId: 'page-url-id',
  sso: ssoToken // Utilisez le jeton SSO généré par le serveur
});

SSO avec création de commentaire

// Côté serveur : créer le SSO et le commentaire
import { FastCommentsSSO, PublicApi } from 'fastcomments-sdk/server';

const sso = FastCommentsSSO.createSecure('your-api-key', userData);
const ssoConfig = sso.prepareToSend();

const response = await publicApi.createCommentPublic({
  tenantId: 'your-tenant-id',
  urlId: 'page-url-id',
  broadcastId: 'unique-broadcast-id',
  commentData: {
    comment: 'This is my comment',
    date: Date.now(),
    commenterName: 'John Doe',
    url: 'https://example.com/page',
    urlId: 'page-url-id'
  },
  sso: JSON.stringify(ssoConfig)
});

Cas d'utilisation courants Internal Link

Récupérer les commentaires d'une page

const comments = await sdk.publicApi.getCommentsPublic({
  tenantId: 'your-tenant-id',
  urlId: 'article-123'
});

Créer un commentaire

const newComment = await sdk.publicApi.createCommentPublic({
  createCommentParams: {
    tenantId: 'your-tenant-id',
    urlId: 'article-123',
    comment: 'Great article!',
    commenterName: 'John Doe',
    commenterEmail: 'john@example.com'
  }
});

Voter sur un commentaire

const voteResponse = await sdk.publicApi.voteComment({
  voteBodyParams: {
    commentId: 'comment-id',
    direction: 1 // 1 pour un vote positif, -1 pour un vote négatif
  }
});

Gestion des utilisateurs (Nécessite une clé API)

// Recherche d'utilisateurs (nécessite DefaultApi)
const users = await sdk.defaultApi.searchUsers({
  tenantId: 'your-tenant-id',
  urlId: 'page-id',
  usernameStartsWith: 'john'
});

Événements en direct (mises à jour en temps réel) Internal Link

Abonnez-vous aux événements en direct pour recevoir des mises à jour en temps réel sur les commentaires, les votes et d'autres activités.

Événements au niveau de la page

Écoutez les événements en direct sur une page spécifique (commentaires, votes, etc.) :

import { subscribeToChanges, LiveEvent, LiveEventType } from 'fastcomments-sdk/browser';

const config = {
  tenantId: 'your-tenant-id',
  urlId: 'page-url-id',
};

// S'abonner aux événements en direct pour une page
const subscription = subscribeToChanges(
  config,
  'your-tenant-id', // tenantIdWS
  'page-url-id',    // urlIdWS  
  'user-session-id', // userIdWS (obtenez ceci à partir de la réponse de getComments)
  (event: LiveEvent) => {
    console.log('Live event received:', event);

    switch (event.type) {
      case LiveEventType.new_comment:
        console.log('New comment:', event.comment);
        // Mettez à jour votre interface utilisateur avec le nouveau commentaire
        break;
      case LiveEventType.new_vote:
        console.log('New vote:', event.vote);
        // Mettez à jour les compteurs de votes dans votre interface utilisateur
        break;
      case LiveEventType.updated_comment:
        console.log('Comment updated:', event.comment);
        break;
      default:
        console.log('Other event type:', event.type);
    }

    return true; // Retournez true si l'événement a été traité
  },
  (isConnected: boolean) => {
    console.log('Connection status:', isConnected ? 'Connected' : 'Disconnected');
  }
);

// Fermez l'abonnement lorsque terminé
subscription.close();

S'abonner aux événements utilisateur

Écoutez les événements spécifiques à un utilisateur (notifications, mentions, etc.) :

import { subscribeToUserFeed, LiveEvent, LiveEventType } from 'fastcomments-sdk/browser';

const userConfig = {
  userIdWS: 'user-session-id', // Obtenez ceci à partir de la réponse de getComments
};

// Abonnez-vous au fil personnel de l'utilisateur
const userSubscription = subscribeToUserFeed(
  userConfig,
  (event: LiveEvent) => {
    console.log('User event received:', event);

    switch (event.type) {
      case LiveEventType.notification:
        console.log('New notification:', event.notification);
        // Affichez la notification dans votre interface utilisateur
        break;
      case LiveEventType.notification_update:
        console.log('Notification updated:', event.notification);
        break;
      default:
        console.log('Other user event:', event.type);
    }

    return true;
  },
  (isConnected: boolean) => {
    console.log('User feed connection:', isConnected ? 'Connected' : 'Disconnected');
  }
);

// Fermez lorsque terminé
userSubscription.close();

Obtenir userIdWS

Le paramètre userIdWS est requis pour les événements en direct et peut être obtenu à partir des réponses de l'API :

const response = await sdk.publicApi.getCommentsPublic({
  tenantId: 'your-tenant-id',
  urlId: 'page-id'
});

// Extraire userIdWS de la réponse
const userIdWS = response.data?.userSessionInfo?.userIdWS;

if (userIdWS) {
  // Vous pouvez maintenant vous abonner aux événements en direct
  const subscription = subscribeToChanges(config, tenantIdWS, urlIdWS, userIdWS, handleEvent);
}

Identifiants de diffusion Internal Link

Vous verrez que vous devez transmettre un broadcastId dans certains appels d'API. Lorsque vous recevrez des événements, vous recevrez cet ID en retour, ce qui vous permet d'ignorer l'événement si vous prévoyez d'appliquer les modifications de façon optimiste sur le client (ce que vous voudrez probablement faire, car cela offre la meilleure expérience). Fournissez un UUID ici. L'ID doit être suffisamment unique pour ne pas apparaître deux fois lors d'une session de navigateur.

import { v4 as uuidv4 } from 'uuid';

const response = await sdk.publicApi.createCommentPublic({
  createCommentParams: {
    tenantId: 'your-tenant-id',
    urlId: 'page-id',
    comment: 'My comment',
    broadcastId: uuidv4() // ID unique pour cette opération
  }
});

Gestion des erreurs Internal Link

try {
  const comments = await sdk.publicApi.getCommentsPublic({
    tenantId: 'your-tenant-id',
    urlId: 'page-id'
  });
} catch (error) {
  if (error.response?.status === 404) {
    console.log('Page not found');
  } else {
    console.error('API Error:', error.message);
  }
}

agréger Internal Link

Agrège des documents en les regroupant (si groupBy est fourni) et en appliquant plusieurs opérations. Différentes opérations (p. ex. sum, countDistinct, avg, etc.) sont prises en charge.

Paramètres

Name Type Required Description
tenantId string Oui
aggregationRequest AggregationRequest Oui
parentTenantId string Non
includeStats boolean Non

Réponse

Retourne : AggregationResponse


obtenir les journaux d'audit Internal Link

Paramètres

Nom Type Obligatoire Description
tenantId string Oui
limit number Non
skip number Non
order SORTDIR Non
after number Non
before number Non

Réponse

Renvoie: GetAuditLogs200Response


bloquer depuis un commentaire public Internal Link


Paramètres

Nom Type Obligatoire Description
tenantId string Oui
commentId string Oui
publicBlockFromCommentParams PublicBlockFromCommentParams Oui
sso string Non

Réponse

Renvoie : BlockFromCommentPublic200Response


débloquer commentaire public Internal Link


Paramètres

Nom Type Obligatoire Description
tenantId string Oui
commentId string Oui
publicBlockFromCommentParams PublicBlockFromCommentParams Oui
sso string Non

Réponse

Renvoie: UnBlockCommentPublic200Response


vérifier les commentaires bloqués Internal Link


Paramètres

Nom Type Obligatoire Description
tenantId string Oui
commentIds string Oui
sso string Non

Réponse

Renvoie: CheckedCommentsForBlocked200Response


bloquer l'utilisateur depuis un commentaire Internal Link

Paramètres

Nom Type Obligatoire Description
tenantId string Oui
id string Oui
blockFromCommentParams BlockFromCommentParams Oui
userId string Non
anonUserId string Non

Réponse

Retourne : BlockFromCommentPublic200Response


créer un commentaire public Internal Link


Paramètres

Nom Type Requis Description
tenantId string Oui
urlId string Oui
broadcastId string Oui
commentData CommentData Oui
sessionId string Non
sso string Non

Réponse

Renvoie: CreateCommentPublic200Response


supprimer le commentaire Internal Link

Paramètres

Nom Type Requis Description
tenantId string Oui
id string Oui
contextUserId string Non
isLive boolean Non

Réponse

Renvoie : DeleteComment200Response


supprimer le commentaire public Internal Link


Paramètres

Nom Type Requis Description
tenantId string Oui
commentId string Oui
broadcastId string Oui
editKey string Non
sso string Non

Réponse

Renvoie : DeleteCommentPublic200Response


supprimer le vote du commentaire Internal Link

Paramètres

Nom Type Requis Description
tenantId string Oui
commentId string Oui
voteId string Oui
urlId string Oui
broadcastId string Oui
editKey string Non
sso string Non

Réponse

Retourne : DeleteCommentVote200Response


signaler le commentaire Internal Link

Paramètres

Nom Type Obligatoire Description
tenantId string Oui
id string Oui
userId string Non
anonUserId string Non

Réponse

Renvoie : FlagComment200Response


obtenir le commentaire Internal Link


Paramètres

Nom Type Requis Description
tenantId string Oui
id string Oui

Réponse

Renvoie: GetComment200Response


obtenir les commentaires Internal Link

Paramètres

Nom Type Obligatoire Description
tenantId string Oui
page number Non
limit number Non
skip number Non
asTree boolean Non
skipChildren number Non
limitChildren number Non
maxTreeDepth number Non
urlId string Non
userId string Non
anonUserId string Non
contextUserId string Non
hashTag string Non
parentId string Non
direction SortDirections Non

Réponse

Renvoie : GetComments200Response


obtenir les commentaires publics Internal Link

req tenantId urlId

Paramètres

Nom Type Requis Description
tenantId string Oui
urlId string Oui
page number Non
direction SortDirections Non
sso string Non
skip number Non
skipChildren number Non
limit number Non
limitChildren number Non
countChildren boolean Non
fetchPageForCommentId string Non
includeConfig boolean Non
countAll boolean Non
includei10n boolean Non
locale string Non
modules string Non
isCrawler boolean Non
includeNotificationCount boolean Non
asTree boolean Non
maxTreeDepth number Non
useFullTranslationIds boolean Non
parentId string Non
searchText string Non
hashTags Array Non
userId string Non
customConfigStr string Non
afterCommentId string Non
beforeCommentId string Non

Réponse

Renvoie : GetCommentsPublic200Response


obtenir le texte du commentaire Internal Link

Paramètres

Nom Type Obligatoire Description
tenantId string Oui
commentId string Oui
editKey string Non
sso string Non

Réponse

Renvoie : GetCommentText200Response


obtenir les noms d'utilisateur des votes de commentaire Internal Link

Paramètres

Nom Type Obligatoire Description
tenantId string Oui
commentId string Oui
dir number Oui
sso string Non

Réponse

Renvoie : GetCommentVoteUserNames200Response


verrouiller le commentaire Internal Link


Paramètres

Name Type Requis Description
tenantId string Oui
commentId string Oui
broadcastId string Oui
sso string Non

Réponse

Renvoie : LockComment200Response


épingler le commentaire Internal Link

Paramètres

Nom Type Requis Description
tenantId string Oui
commentId string Oui
broadcastId string Oui
sso string Non

Réponse

Renvoie: PinComment200Response

enregistrer le commentaire Internal Link

Paramètres

Nom Type Requis Description
tenantId string Oui
createCommentParams CreateCommentParams Oui
isLive boolean Non
doSpamCheck boolean Non
sendEmails boolean Non
populateNotifications boolean Non

Réponse

Renvoie : SaveComment200Response


enregistrer des commentaires en masse Internal Link


Paramètres

Nom Type Requis Description
tenantId string Oui
createCommentParams Array Oui
isLive boolean Non
doSpamCheck boolean Non
sendEmails boolean Non
populateNotifications boolean Non

Réponse

Retourne: Array<SaveComment200Response


définir le texte du commentaire Internal Link


Paramètres

Nom Type Obligatoire Description
tenantId string Oui
commentId string Oui
broadcastId string Oui
commentTextUpdateRequest CommentTextUpdateRequest Oui
editKey string Non
sso string Non

Réponse

Renvoie : SetCommentText200Response


débloquer l'utilisateur depuis le commentaire Internal Link

Paramètres

Nom Type Requis Description
tenantId string Oui
id string Oui
unBlockFromCommentParams UnBlockFromCommentParams Oui
userId string Non
anonUserId string Non

Réponse

Retourne : UnBlockCommentPublic200Response


annuler le signalement du commentaire Internal Link


Paramètres

Nom Type Obligatoire Description
tenantId string Oui
id string Oui
userId string Non
anonUserId string Non

Réponse

Retourne : FlagComment200Response


déverrouiller le commentaire Internal Link

Paramètres

Nom Type Obligatoire Description
tenantId string Oui
commentId string Oui
broadcastId string Oui
sso string Non

Réponse

Renvoie: LockComment200Response


désépingler le commentaire Internal Link


Paramètres

Nom Type Obligatoire Description
tenantId string Oui
commentId string Oui
broadcastId string Oui
sso string Non

Réponse

Renvoie : PinComment200Response


mettre à jour le commentaire Internal Link

Paramètres

Nom Type Obligatoire Description
tenantId string Oui
id string Oui
body PickAPICommentUpdatableCommentFields Oui
contextUserId string Non
doSpamCheck boolean Non
isLive boolean Non

Réponse

Retourne: FlagCommentPublic200Response


voter pour le commentaire Internal Link

Paramètres

Nom Type Obligatoire Description
tenantId string Oui
commentId string Oui
urlId string Oui
broadcastId string Oui
voteBodyParams VoteBodyParams Oui
sessionId string Non
sso string Non

Réponse

Retourne: VoteComment200Response


ajouter une configuration de domaine Internal Link

Paramètres

Nom Type Requis Description
tenantId string Oui
addDomainConfigParams AddDomainConfigParams Oui

Réponse

Renvoie: AddDomainConfig200Response


supprimer la configuration de domaine Internal Link

Paramètres

Nom Type Requis Description
tenantId string Oui
domain string Oui

Réponse

Renvoie: DeleteDomainConfig200Response


obtenir la configuration de domaine Internal Link

Paramètres

Nom Type Obligatoire Description
tenantId string Oui
domain string Oui

Réponse

Renvoie: GetDomainConfig200Response


obtenir les configurations de domaine Internal Link


Paramètres

Nom Type Requis Description
tenantId string Oui

Réponse

Retourne: GetDomainConfigs200Response


modifier partiellement la configuration de domaine Internal Link

Paramètres

Nom Type Requis Description
tenantId string Oui
domainToUpdate string Oui
patchDomainConfigParams PatchDomainConfigParams Oui

Réponse

Retourne : GetDomainConfig200Response

remplacer la configuration de domaine Internal Link

Paramètres

Name Type Obligatoire Description
tenantId string Oui
domainToUpdate string Oui
updateDomainConfigParams UpdateDomainConfigParams Oui

Réponse

Renvoie : GetDomainConfig200Response


créer un modèle de courriel Internal Link

Paramètres

Nom Type Obligatoire Description
tenantId string Oui
createEmailTemplateBody CreateEmailTemplateBody Oui

Réponse

Renvoie : CreateEmailTemplate200Response

Exemple

Exemple de createEmailTemplate
Copy Copy
1
2const tenantId: string = "tenant_7a9f2b3d";
3
4const createEmailTemplateBody: CreateEmailTemplateBody = {
5 name: "Comment Notification",
6 subject: "New comment on your article: ",
7 htmlBody: "<p> left a comment:</p><blockquote></blockquote>",
8 enabled: true,
9 defaultLocale: "en-US",
10 metadata: { createdBy: "admin@example.com", purpose: "notify_comment" } // données supplémentaires optionnelles
11};
12
13const result: CreateEmailTemplate200Response = await createEmailTemplate(tenantId, createEmailTemplateBody);
14

supprimer le modèle de courriel Internal Link

Paramètres

Nom Type Requis Description
tenantId string Oui
id string Oui

Réponse

Renvoie : FlagCommentPublic200Response

Exemple

Exemple de deleteEmailTemplate
Copy Copy
1
2const tenantId: string = "tenant_4b2f6a-4b2f6a2d";
3const templateId: string = "email_template_9f8b7c3e";
4const result: FlagCommentPublic200Response = await deleteEmailTemplate(tenantId, templateId);
5const status: APIStatus | undefined = result?.status
6

supprimer l'erreur de rendu du modèle de courriel Internal Link

Paramètres

Nom Type Requis Description
tenantId string Oui
id string Oui
errorId string Oui

Réponse

Renvoie: FlagCommentPublic200Response

Exemple

Exemple de deleteEmailTemplateRenderError
Copy Copy
1
2const tenantId: string = "tenant_8f3b2a9c";
3const id: string = "template_4a1c9f7e";
4const errorId: string = "err_20260112_abc123";
5const result: FlagCommentPublic200Response = await deleteEmailTemplateRenderError(tenantId, id, errorId);
6

obtenir le modèle de courriel Internal Link

Paramètres

Name Type Obligatoire Description
tenantId string Oui
id string Oui

Réponse

Renvoie : GetEmailTemplate200Response

Exemple

Exemple de getEmailTemplate
Copy Copy
1
2(async () => {
3 const tenantId: string = 'acme-enterprises-123';
4 const id: string = 'welcome-email-template-v2';
5 const locale: string | undefined = 'en-US'; // exemple de paramètre optionnel
6 const template: GetEmailTemplate200Response = await getEmailTemplate(tenantId, id);
7 console.log(template, locale);
8})();
9

obtenir les définitions des modèles de courriel Internal Link

Parameters

Nom Type Requis Description
tenantId string Oui

Réponse

Renvoie : GetEmailTemplateDefinitions200Response

Exemple

Exemple de getEmailTemplateDefinitions
Copy Copy
1
2const tenantId: string = 'acme-enterprises-78f2';
3const emailTemplates: GetEmailTemplateDefinitions200Response = await getEmailTemplateDefinitions(tenantId);
4

obtenir les erreurs de rendu des modèles de courriel Internal Link

Paramètres

Name Type Required Description
tenantId string Oui
id string Oui
skip number Non

Réponse

Renvoie : GetEmailTemplateRenderErrors200Response

Exemple

Exemple de getEmailTemplateRenderErrors
Copy Copy
1
2const tenantId: string = "tenant_7b3f2a9c";
3const id: string = "tmpl_4f1b2c9e";
4const skip: number = 25;
5const result: GetEmailTemplateRenderErrors200Response = await getEmailTemplateRenderErrors(tenantId, id, skip);
6

obtenir les modèles de courriel Internal Link

Paramètres

Nom Type Requis Description
tenantId string Oui
skip number Non

Réponse

Renvoie : GetEmailTemplates200Response

Exemple

Exemple de getEmailTemplates
Copy Copy
1
2const tenantId: string = 'tenant_8f4d2b7c';
3const responseWithoutSkip: GetEmailTemplates200Response = await getEmailTemplates(tenantId);
4const skip: number = 20;
5const responseWithSkip: GetEmailTemplates200Response = await getEmailTemplates(tenantId, skip);
6

générer le rendu du modèle de courriel Internal Link

Paramètres

Nom Type Requis Description
tenantId string Oui
renderEmailTemplateBody RenderEmailTemplateBody Oui
locale string Non

Réponse

Retourne: RenderEmailTemplate200Response

Exemple

Exemple de renderEmailTemplate
Copy Copy
1
2const tenantId: string = 'acme-corp-7f3';
3const renderEmailTemplateBody: RenderEmailTemplateBody = {
4 templateId: 'new-comment-notification',
5 recipientEmail: 'jane.doe@acme.com',
6 variables: {
7 commenterName: 'Samir Patel',
8 commentText: 'I found this article really helpful — thanks for sharing!',
9 threadUrl: 'https://acme.com/blog/123#comments'
10 },
11 includeUnsubscribeLink: true
12};
13const locale: string = 'en-US';
14const response: RenderEmailTemplate200Response = await renderEmailTemplate(tenantId, renderEmailTemplateBody, locale);
15

mettre à jour le modèle de courriel Internal Link

Paramètres

Name Type Obligatoire Description
tenantId string Oui
id string Oui
updateEmailTemplateBody UpdateEmailTemplateBody Oui

Réponse

Renvoie: FlagCommentPublic200Response

Exemple

Exemple de updateEmailTemplate
Copy Copy
1
2const tenantId: string = 'acme-corp-tenant-01';
3const id: string = 'email_tpl_42b7a9';
4const updateEmailTemplateBody: UpdateEmailTemplateBody = {
5 name: 'Comment Flag Notification',
6 subject: 'A comment was flagged on acme.com',
7 html: '<p>A comment by was flagged. Review at </p>',
8 replyTo: 'noreply@acme.com', // champ facultatif démontré
9 enabled: true,
10 customConfig: { priority: 'high' } // paramètres personnalisés facultatifs
11};
12const response: FlagCommentPublic200Response = await updateEmailTemplate(tenantId, id, updateEmailTemplateBody);
13

obtenir le journal d'événements Internal Link

req tenantId urlId userIdWS

Paramètres

Nom Type Requis Description
tenantId string Oui
urlId string Oui
userIdWS string Oui
startTime number Oui
endTime number Oui

Réponse

Retourne: GetEventLog200Response

obtenir le journal d'événements global Internal Link

req tenantId urlId userIdWS

Paramètres

Nom Type Obligatoire Description
tenantId string Oui
urlId string Oui
userIdWS string Oui
startTime number Oui
endTime number Oui

Réponse

Renvoie: GetEventLog200Response


créer une publication de flux Internal Link

Paramètres

Nom Type Requis Description
tenantId string Oui
createFeedPostParams CreateFeedPostParams Oui
broadcastId string Non
isLive boolean Non
doSpamCheck boolean Non
skipDupCheck boolean Non

Réponse

Retourne: CreateFeedPost200Response


créer une publication de flux publique Internal Link

Paramètres

Nom Type Obligatoire Description
tenantId string Oui
createFeedPostParams CreateFeedPostParams Oui
broadcastId string Non
sso string Non

Réponse

Retourne: CreateFeedPostPublic200Response

supprimer la publication de flux publique Internal Link

Paramètres

Nom Type Obligatoire Description
tenantId string Oui
postId string Oui
broadcastId string Non
sso string Non

Réponse

Renvoie: DeleteFeedPostPublic200Response


obtenir les publications de flux Internal Link

req tenantId afterId

Paramètres

Nom Type Requis Description
tenantId string Oui
afterId string Non
limit number Non
tags Array Non

Réponse

Retourne : GetFeedPosts200Response

obtenir les publications de flux publiques Internal Link

req tenantId afterId

Paramètres

Nom Type Obligatoire Description
tenantId string Oui
afterId string Non
limit number Non
tags Array Non
sso string Non
isCrawler boolean Non
includeUserInfo boolean Non

Réponse

Retourne : GetFeedPostsPublic200Response

obtenir les statistiques des publications de flux Internal Link

Paramètres

Nom Type Requis Description
tenantId string Oui
postIds Array Oui
sso string Non

Réponse

Retourne: GetFeedPostsStats200Response


obtenir les réactions utilisateur publiques Internal Link


Paramètres

Nom Type Requis Description
tenantId string Oui
postIds Array Non
sso string Non

Réponse

Renvoie : GetUserReactsPublic200Response


réagir à une publication de flux publique Internal Link

Paramètres

Nom Type Obligatoire Description
tenantId string Oui
postId string Oui
reactBodyParams ReactBodyParams Oui
isUndo boolean Non
broadcastId string Non
sso string Non

Réponse

Renvoie : ReactFeedPostPublic200Response


mettre à jour la publication de flux Internal Link

Paramètres

Nom Type Requis Description
tenantId string Oui
id string Oui
feedPost FeedPost Oui

Réponse

Retourne : FlagCommentPublic200Response


mettre à jour la publication de flux publique Internal Link


Paramètres

Nom Type Requis Description
tenantId string Oui
postId string Oui
updateFeedPostParams UpdateFeedPostParams Oui
broadcastId string Non
sso string Non

Réponse

Retourne : CreateFeedPostPublic200Response


signaler le commentaire public Internal Link

Paramètres

Nom Type Obligatoire Description
tenantId string Oui
commentId string Oui
isFlagged boolean Oui
sso string Non

Réponse

Renvoie: FlagCommentPublic200Response


ajouter un mot-clic Internal Link

Paramètres

Name Type Required Description
tenantId string Non
createHashTagBody CreateHashTagBody Non

Réponse

Retourne: AddHashTag200Response

Exemple

Exemple de addHashTag
Copy Copy
1
2const tenantId: string = 'tenant_7b2f6c2b';
3const createBody: CreateHashTagBody = {
4 tag: 'feature-request',
5 label: 'Feature Request',
6 description: 'Requests for new functionality in the web client',
7 isActive: true,
8 visibility: 'public',
9 allowedDomains: ['example.com', 'internal.example.com']
10};
11const result: AddHashTag200Response = await addHashTag(tenantId, createBody);
12const resultWithoutTenant: AddHashTag200Response = await addHashTag(undefined, {
13 tag: 'bug',
14 label: 'Bug',
15 description: 'Use for reproducible bugs reported by users',
16 isActive: true,
17 visibility: 'public'
18});
19

ajouter des mots-clics en masse Internal Link

Paramètres

Nom Type Requis Description
tenantId string No
bulkCreateHashTagsBody BulkCreateHashTagsBody No

Réponse

Renvoie : AddHashTagsBulk200Response

Exemple

Exemple pour addHashTagsBulk
Copy Copy
1
2(async () => {
3 const tenantId: string = 'tenant_3f2b9a';
4 const bulkCreateHashTagsBody: BulkCreateHashTagsBody = {
5 tags: [
6 { name: 'performance', description: 'Comments about site performance', visibleToModeratorsOnly: false },
7 { name: 'feature-request', description: 'Requests for new features', visibleToModeratorsOnly: true }
8 ]
9 };
10 const result: AddHashTagsBulk200Response = await addHashTagsBulk(tenantId, bulkCreateHashTagsBody);
11 const resultWithNoTenant: AddHashTagsBulk200Response = await addHashTagsBulk(undefined, bulkCreateHashTagsBody);
12 console.log(result, resultWithNoTenant);
13})();
14

supprimer le mot-clic Internal Link

Paramètres

Nom Type Requis Description
tag string Oui
tenantId string Non
deleteHashTagRequest DeleteHashTagRequest Non

Réponse

Retourne: FlagCommentPublic200Response

Exemple

Exemple de deleteHashTag
Copy Copy
1
2const tag: string = 'breaking-news';
3const tenantId: string = 'tenant_42';
4const deleteReq: DeleteHashTagRequest = { removedBy: 'moderator_jane', reason: 'off-topic for this community', deleteAssociatedComments: true } as DeleteHashTagRequest;
5const result: FlagCommentPublic200Response = await deleteHashTag(tag, tenantId, deleteReq);
6

obtenir les mots-clics Internal Link

Paramètres

Nom Type Requis Description
tenantId string Oui
page number Non

Réponse

Retourne: GetHashTags200Response

Exemple

Exemple getHashTags
Copy Copy
1
2(async () => {
3 const tenantId: string = "acme-corp-7a9f";
4 const tagsPage1: GetHashTags200Response = await getHashTags(tenantId);
5 const tagsPage2: GetHashTags200Response = await getHashTags(tenantId, 2);
6 console.log(tagsPage1, tagsPage2);
7})();
8

modifier partiellement le mot-clic Internal Link

Paramètres

Nom Type Requis Description
tag string Oui
tenantId string Non
updateHashTagBody UpdateHashTagBody Non

Réponse

Renvoie: PatchHashTag200Response

Exemple

Exemple de patchHashTag
Copy Copy
1
2const tag: string = 'release-2026';
3const tenantId: string = 'tenant_42';
4const updateHashTagBody: UpdateHashTagBody = {
5 displayName: 'Release 2026',
6 description: 'Discussions and notes for the 2026 product release',
7 isActive: true
8};
9const result: PatchHashTag200Response = await patchHashTag(tag, tenantId, updateHashTagBody);
10

créer un modérateur Internal Link

Paramètres

Nom Type Requis Description
tenantId string Oui
createModeratorBody CreateModeratorBody Oui

Réponse

Retourne: CreateModerator200Response

Exemple

Exemple de createModerator
Copy Copy
1
2const tenantId: string = "tenant_prod_us-east_01";
3const createModeratorBody: CreateModeratorBody = {
4 email: "maria.lopez+mod@fastcompany.com",
5 username: "mlopez_mod",
6 displayName: "Maria Lopez",
7 roles: ["content_moderator"],
8 notifyOnReports: true,
9 metadata: { region: "us-east", team: "community" }
10};
11const result: CreateModerator200Response = await createModerator(tenantId, createModeratorBody);
12

supprimer le modérateur Internal Link

Paramètres

Nom Type Requis Description
tenantId string Oui
id string Oui
sendEmail string Non

Réponse

Retourne : FlagCommentPublic200Response

Exemple

Exemple de deleteModerator
Copy Copy
1
2const tenantId: string = 'acme-tenant-987';
3const moderatorId: string = 'mod-78b2c9a4-3f1e-4d6a';
4const sendEmail: string = 'true';
5const result: FlagCommentPublic200Response = await deleteModerator(tenantId, moderatorId, sendEmail);
6

obtenir le modérateur Internal Link


Paramètres

Nom Type Obligatoire Description
tenantId string Oui
id string Oui

Réponse

Renvoie: GetModerator200Response

Exemple

Exemple de getModerator
Copy Copy
1
2const tenantId: string = "tenant_eu_4f8d2b9e";
3const maybeModeratorId: string | undefined = "mod_91c3b7a2"; // source optionnelle (pourrait être indéfinie)
4const moderator: GetModerator200Response = await getModerator(tenantId, maybeModeratorId!);
5

obtenir les modérateurs Internal Link

Paramètres

Nom Type Requis Description
tenantId string Oui
skip number Non

Réponse

Renvoie : GetModerators200Response

Exemple

Exemple de getModerators
Copy Copy
1
2const tenantId: string = "tenant_corp_7f9b2a";
3const moderatorsPage1: GetModerators200Response = await getModerators(tenantId);
4const skip: number = 50;
5const moderatorsPage2: GetModerators200Response = await getModerators(tenantId, skip);
6

envoyer une invitation Internal Link

Paramètres

Nom Type Obligatoire Description
tenantId string Oui
id string Oui
fromName string Oui

Réponse

Retourne: FlagCommentPublic200Response

Exemple

Exemple de sendInvite
Copy Copy
1
2const tenantId: string = 'acme-tenant-004';
3const id: string = 'comment_9b7f3a2c';
4const fromName: string = 'María Hernández';
5const response: FlagCommentPublic200Response = await sendInvite(tenantId, id, fromName);
6

mettre à jour le modérateur Internal Link

Paramètres

Name Type Required Description
tenantId string Oui
id string Oui
updateModeratorBody UpdateModeratorBody Oui

Réponse

Renvoie : FlagCommentPublic200Response

Exemple

Exemple pour updateModerator
Copy Copy
1
2const tenantId: string = '4f8a9c2e-3b6d-4d9e-8c2f-1a2b3c4d5e6f';
3const id: string = 'mod_92a7c4';
4const updateModeratorBodyMinimal: UpdateModeratorBody = { displayName: 'Sophia Patel' };
5const updateModeratorBodyWithOptional: UpdateModeratorBody = {
6 displayName: 'Sophia Patel',
7 email: 'sophia.patel@newsroom.example',
8 permissions: ['remove_comments', 'ban_user'],
9 notifyOnFlag: true // paramètre optionnel démontré
10};
11const result: FlagCommentPublic200Response = await updateModerator(tenantId, id, updateModeratorBodyWithOptional);
12

supprimer le décompte des notifications Internal Link

Paramètres

Nom Type Requis Description
tenantId string Oui
id string Oui

Réponse

Renvoie : FlagCommentPublic200Response

Exemple

Exemple de deleteNotificationCount
Copy Copy
1
2const tenantId: string = 'tenant_7f3a1b2c4d9e';
3const notificationId: string = 'notif_8c9d0a1b2f3e4b7';
4const result: FlagCommentPublic200Response = await deleteNotificationCount(tenantId, notificationId);
5

obtenir le décompte des notifications en cache Internal Link

Paramètres

Nom Type Requis Description
tenantId string Oui
id string Oui

Réponse

Retourne: GetCachedNotificationCount200Response

Exemple

Exemple de getCachedNotificationCount
Copy Copy
1
2const tenantId: string = 'acme-tenant-01';
3const baseNotificationId: string = 'notif-000123';
4const idSuffix: string | undefined = undefined; // exemple de paramètre optionnel
5const notificationId: string = idSuffix ? `${baseNotificationId}-${idSuffix}` : baseNotificationId;
6const result: GetCachedNotificationCount200Response = await getCachedNotificationCount(tenantId, notificationId);
7console.log(result);
8

obtenir le nombre de notifications Internal Link

Paramètres

Nom Type Requis Description
tenantId string Oui
userId string Non
urlId string Non
fromCommentId string Non
viewed boolean Non
type string Non

Réponse

Renvoie : GetNotificationCount200Response

Exemple

Exemple de getNotificationCount
Copy Copy
1
2const tenantId: string = 'tenant_8a9b7c';
3const userId: string = 'user_42b3c';
4const urlId: string = 'https://blog.example.com/posts/introducing-new-editor';
5const fromCommentId: string | undefined = undefined;
6const viewed: boolean = false;
7const type: string = 'mention';
8const result: GetNotificationCount200Response = await getNotificationCount(tenantId, userId, urlId, fromCommentId, viewed, type);
9

obtenir les notifications Internal Link

Paramètres

Nom Type Requis Description
tenantId string Oui
userId string Non
urlId string Non
fromCommentId string Non
viewed boolean Non
type string Non
skip number Non

Réponse

Renvoie : GetNotifications200Response

Exemple

Exemple de getNotifications
Copy Copy
1
2(async () => {
3 const tenantId: string = 'tenant_8f3b1a2c';
4 const userId: string = 'user_42';
5 const urlId: string = 'https://news.example.com/articles/2026/01/11/comment-thread';
6 const fromCommentId: string = 'cmt_9a7b';
7 const viewed: boolean = false;
8 const type: string = 'mention';
9 const skip: number = 0;
10 const response: GetNotifications200Response = await getNotifications(tenantId, userId, urlId, fromCommentId, viewed, type, skip);
11 console.log(response);
12})();
13

mettre à jour la notification Internal Link

Paramètres

Nom Type Obligatoire Description
tenantId string Oui
id string Oui
updateNotificationBody UpdateNotificationBody Oui
userId string Non

Réponse

Retourne : FlagCommentPublic200Response

Exemple

Exemple pour updateNotification
Copy Copy
1
2const tenantId: string = "tenant_86a7b3";
3const id: string = "notif_20260112_01";
4const userId: string = "moderator_42";
5const updateNotificationBody: UpdateNotificationBody = {
6 name: "Flagged comment alert",
7 enabled: true,
8 channels: ["email"],
9 recipients: ["mod-team@news-site.com"],
10 threshold: 1
11};
12
13(async () => {
14 const result: FlagCommentPublic200Response = await updateNotification(tenantId, id, updateNotificationBody, userId);
15 console.log(result);
16})();
17

ajouter une page Internal Link

Paramètres

Nom Type Requis Description
tenantId string Oui
createAPIPageData CreateAPIPageData Oui

Réponse

Renvoie: AddPageAPIResponse


supprimer la page Internal Link

Paramètres

Nom Type Obligatoire Description
tenantId string Oui
id string Oui

Réponse

Renvoie : DeletePageAPIResponse

obtenir la page par ID d'URL Internal Link


Paramètres

Nom Type Requis Description
tenantId string Oui
urlId string Oui

Réponse

Renvoie : GetPageByURLIdAPIResponse


obtenir les pages Internal Link

Paramètres

Nom Type Obligatoire Description
tenantId string Oui

Réponse

Renvoie: GetPagesAPIResponse

modifier partiellement la page Internal Link

Paramètres

Nom Type Obligatoire Description
tenantId string Oui
id string Oui
updateAPIPageData UpdateAPIPageData Oui

Réponse

Retourne : PatchPageAPIResponse

supprimer l'événement webhook en attente Internal Link

Paramètres

Name Type Required Description
tenantId string Oui
id string Oui

Réponse

Renvoie: FlagCommentPublic200Response

Exemple

Exemple de deletePendingWebhookEvent
Copy Copy
1
2const tenantId: string = 'tenant_7f4e2b';
3const pendingEventId: string = '9f7b6a8c-3b2a-4c0d-a8e5-1234567890ab';
4const result: FlagCommentPublic200Response = await deletePendingWebhookEvent(tenantId, pendingEventId);
5console.log(result);
6

obtenir le nombre d'événements webhook en attente Internal Link

Paramètres

Name Type Obligatoire Description
tenantId string Oui
commentId string Non
externalId string Non
eventType string Non
type string Non
domain string Non
attemptCountGT number Non

Réponse

Renvoie : GetPendingWebhookEventCount200Response

Exemple

Exemple de getPendingWebhookEventCount
Copy Copy
1
2(async () => {
3 const tenantId: string = 'tenant_9c3b2b';
4 const commentId: string = 'cmt_f4a1b2';
5 const externalId: string = 'ext-789';
6 const eventType: string = 'comment.created';
7 const type: string = 'delivery';
8 const domain: string = 'app.example.com';
9 const attemptCountGT: number = 2;
10
11 const result: GetPendingWebhookEventCount200Response = await getPendingWebhookEventCount(
12 tenantId,
13 commentId,
14 externalId,
15 eventType,
16 type,
17 domain,
18 attemptCountGT
19 );
20
21 console.log(result);
22})();
23

obtenir les événements webhook en attente Internal Link

Paramètres

Nom Type Obligatoire Description
tenantId string Oui
commentId string Non
externalId string Non
eventType string Non
type string Non
domain string Non
attemptCountGT number Non
skip number Non

Réponse

Retourne : GetPendingWebhookEvents200Response

Exemple

Exemple de getPendingWebhookEvents
Copy Copy
1
2const tenantId: string = "tenant_78b2f1";
3const commentId: string = "cmt_0042";
4const eventType: string = "comment.created";
5const domain: string = "blog.example.com";
6const attemptCountGT: number = 1;
7const skip: number = 0;
8
9const pending: GetPendingWebhookEvents200Response = await getPendingWebhookEvents(
10 tenantId,
11 commentId,
12 undefined, // externalId
13 eventType,
14 undefined, // type
15 domain,
16 attemptCountGT,
17 skip
18);
19

créer une configuration de question Internal Link

Paramètres

Nom Type Requis Description
tenantId string Oui
createQuestionConfigBody CreateQuestionConfigBody Oui

Réponse

Renvoie: CreateQuestionConfig200Response

Exemple

Exemple de createQuestionConfig
Copy Copy
1
2const tenantId: string = "tenant_live_7f8b3c2a";
3const customOptions: QuestionConfigCustomOptionsInner[] = [
4 { value: "under18", label: "Under 18" },
5 { value: "18-24", label: "18-24" },
6 { value: "25-34", label: "25-34", defaultSelected: true }
7];
8const createQuestionConfigBody: CreateQuestionConfigBody = {
9 key: "age_range",
10 label: "What is your age range?",
11 required: false, // facultatif : démontrer les champs optionnels omis vs inclus
12 renderingType: QuestionRenderingType.Dropdown,
13 options: customOptions,
14 whenSave: QuestionWhenSave.Always
15};
16const result: CreateQuestionConfig200Response = await createQuestionConfig(tenantId, createQuestionConfigBody);
17

supprimer la configuration de question Internal Link

Paramètres

Nom Type Requis Description
tenantId string Oui
id string Oui

Réponse

Renvoie : FlagCommentPublic200Response

Exemple

Exemple de deleteQuestionConfig
Copy Copy
1
2async function deleteIfPresent(tenantId: string, id?: string): Promise<FlagCommentPublic200Response | null> {
3 if (!id) return null;
4 const result: FlagCommentPublic200Response = await deleteQuestionConfig(tenantId, id);
5 return result;
6}
7const tenantId: string = 'tenant_acme_001';
8const optionalConfigId: string | undefined = 'qcfg_20260112_01';
9(async (): Promise<void> => {
10 const deleted: FlagCommentPublic200Response | null = await deleteIfPresent(tenantId, optionalConfigId);
11 void deleted;
12})();
13

obtenir la configuration de question Internal Link

Paramètres

Nom Type Obligatoire Description
tenantId string Oui
id string Oui

Réponse

Renvoie: GetQuestionConfig200Response

Exemple

Exemple de getQuestionConfig
Copy Copy
1
2const tenantId: string = 'acme-corp-47';
3const questionId: string = 'q-2026-01-12-01';
4const result: GetQuestionConfig200Response = await getQuestionConfig(tenantId, questionId);
5function summarizeConfig(cfg: GetQuestionConfig200Response, includeMetadata?: boolean): QuestionConfig | undefined {
6 // includeMetadata est facultatif; implémentation omise par souci de concision
7 return undefined;
8}
9const summarizedWithMeta: QuestionConfig | undefined = summarizeConfig(result, true);
10const summarizedDefault: QuestionConfig | undefined = summarizeConfig(result);
11

obtenir les configurations de question Internal Link

Paramètres

Nom Type Requis Description
tenantId string Oui
skip number Non

Réponse

Renvoie : GetQuestionConfigs200Response

Exemple

Exemple getQuestionConfigs
Copy Copy
1
2const tenantId: string = 'tenant-42a7b9';
3const firstPage: GetQuestionConfigs200Response = await getQuestionConfigs(tenantId);
4const secondPage: GetQuestionConfigs200Response = await getQuestionConfigs(tenantId, 50);
5

mettre à jour la configuration de question Internal Link

Paramètres

Nom Type Obligatoire Description
tenantId string Oui
id string Oui
updateQuestionConfigBody UpdateQuestionConfigBody Oui

Réponse

Retourne : FlagCommentPublic200Response

Exemple

Exemple de updateQuestionConfig
Copy Copy
1
2const tenantId: string = 'tenant-82b3a';
3const id: string = 'qst-20260112';
4const updateQuestionConfigBody: UpdateQuestionConfigBody = { label: 'Age verification', required: true, renderingType: 'singleChoice', customOptions: [{ value: '18-24', label: '18–24' }] } as UpdateQuestionConfigBody;
5const result: FlagCommentPublic200Response = await updateQuestionConfig(tenantId, id, updateQuestionConfigBody);
6

créer un résultat de question Internal Link

Paramètres

Nom Type Requis Description
tenantId string Oui
createQuestionResultBody CreateQuestionResultBody Oui

Réponse

Renvoie : CreateQuestionResult200Response

Exemple

Exemple de createQuestionResult
Copy Copy
1
2const tenantId: string = "fc_tenant_7a3c_us-east-1";
3const metaItem: MetaItem = { key: "referrer", value: "/blog/how-to-comment" };
4const createQuestionResultBody: CreateQuestionResultBody = {
5 questionId: "q_42",
6 commenterId: "user_1984",
7 answer: "yes",
8 score: 4,
9 meta: [metaItem] // métadonnées optionnelles démontrées
10} as CreateQuestionResultBody;
11const result: CreateQuestionResult200Response = await createQuestionResult(tenantId, createQuestionResultBody);
12

supprimer le résultat de question Internal Link

Paramètres

Nom Type Requis Description
tenantId string Oui
id string Oui

Réponse

Renvoie : FlagCommentPublic200Response

Exemple

Exemple de deleteQuestionResult
Copy Copy
1
2const tenantId: string = 'acme-tenant-01';
3const questionResultId: string = '6f1a2b3c-4d5e-6789-abcd-ef0123456789';
4const deletedResult: FlagCommentPublic200Response = await deleteQuestionResult(tenantId, questionResultId);
5console.log(deletedResult);
6

obtenir le résultat de question Internal Link

Paramètres

Nom Type Requis Description
tenantId string Oui
id string Oui

Réponse

Renvoie : GetQuestionResult200Response

Exemple

Exemple de getQuestionResult
Copy Copy
1
2const tenantId: string = "3fa85f64-5717-4562-b3fc-2c963f66afa6";
3const questionId: string = "question_72f1b9c3a4";
4const result: GetQuestionResult200Response = await getQuestionResult(tenantId, questionId);
5console.log(result);
6

obtenir les résultats de question Internal Link

Paramètres

Nom Type Obligatoire Description
tenantId string Oui
urlId string Non
userId string Non
startDate string Non
questionId string Non
questionIds string Non
skip number Non

Réponse

Renvoie: GetQuestionResults200Response

Exemple

Exemple de getQuestionResults
Copy Copy
1
2const tenantId: string = 'tenant_42';
3const urlId: string = 'news/2025/fastcomments-release';
4const userId: string = 'user_8b7f3c';
5const startDate: string = '2025-01-01T00:00:00Z';
6const questionIds: string = 'q123,q124';
7const skip: number = 20;
8const result: GetQuestionResults200Response = await getQuestionResults(tenantId, urlId, userId, startDate, undefined, questionIds, skip);
9

mettre à jour le résultat de question Internal Link

Paramètres

Nom Type Requis Description
tenantId string Oui
id string Oui
updateQuestionResultBody UpdateQuestionResultBody Oui

Réponse

Retourne : FlagCommentPublic200Response

Exemple

Exemple de updateQuestionResult
Copy Copy
1
2const tenantId: string = 'tenant_84f2b9';
3const id: string = 'question_3a7c1d';
4const updateQuestionResultBody: UpdateQuestionResultBody = {
5 result: { verdict: 'helpful', confidence: 0.92 },
6 reviewer: { id: 'mod_102', name: 'Aisha Rahman' },
7 notifyUser: true // paramètre optionnel inclus
8};
9const response: FlagCommentPublic200Response = await updateQuestionResult(tenantId, id, updateQuestionResultBody);
10

agréger les résultats de question Internal Link

Paramètres

Name Type Requis Description
tenantId string Oui
questionId string Non
questionIds Array Non
urlId string Non
timeBucket AggregateTimeBucket Non
startDate Date Non
forceRecalculate boolean Non

Réponse

Renvoie : AggregateQuestionResults200Response


agréger en masse les résultats de question Internal Link

Paramètres

Nom Type Requis Description
tenantId string Oui
bulkAggregateQuestionResultsRequest BulkAggregateQuestionResultsRequest Oui
forceRecalculate boolean Non

Réponse

Renvoie : BulkAggregateQuestionResults200Response


combiner les commentaires avec les résultats de question Internal Link

Paramètres

Nom Type Requis Description
tenantId string Oui
questionId string Non
questionIds Array Non
urlId string Non
startDate Date Non
forceRecalculate boolean Non
minValue number Non
maxValue number Non
limit number Non

Réponse

Retourne : CombineCommentsWithQuestionResults200Response


ajouter un utilisateur SSO Internal Link


Paramètres

Nom Type Requis Description
tenantId string Oui
createAPISSOUserData CreateAPISSOUserData Oui

Réponse

Retourne : AddSSOUserAPIResponse


supprimer un utilisateur SSO Internal Link

Paramètres

Nom Type Obligatoire Description
tenantId string Oui
id string Oui
deleteComments boolean Non
commentDeleteMode string Non

Réponse

Renvoie : DeleteSSOUserAPIResponse


obtenir l'utilisateur SSO par courriel Internal Link

Paramètres

Nom Type Obligatoire Description
tenantId string Oui
email string Oui

Réponse

Renvoie: GetSSOUserByEmailAPIResponse


obtenir l'utilisateur SSO par ID Internal Link


Paramètres

Nom Type Requis Description
tenantId string Oui
id string Oui

Réponse

Retourne : GetSSOUserByIdAPIResponse


obtenir les utilisateurs SSO Internal Link

Paramètres

Nom Type Requis Description
tenantId string Oui
skip number Non

Réponse

Retourne : GetSSOUsers200Response


modifier partiellement l'utilisateur SSO Internal Link

Paramètres

Nom Type Obligatoire Description
tenantId string Oui
id string Oui
updateAPISSOUserData UpdateAPISSOUserData Oui
updateComments boolean Non

Réponse

Renvoie: PatchSSOUserAPIResponse


remplacer l'utilisateur SSO Internal Link

Paramètres

Nom Type Obligatoire Description
tenantId string Oui
id string Oui
updateAPISSOUserData UpdateAPISSOUserData Oui
updateComments boolean Non

Réponse

Renvoie : PutSSOUserAPIResponse


créer un abonnement Internal Link

Paramètres

Nom Type Requis Description
tenantId string Oui
createAPIUserSubscriptionData CreateAPIUserSubscriptionData Oui

Réponse

Retourne: CreateSubscriptionAPIResponse


supprimer l'abonnement Internal Link


Paramètres

Nom Type Obligatoire Description
tenantId string Oui
id string Oui
userId string Non

Réponse

Retourne : DeleteSubscriptionAPIResponse


obtenir les abonnements Internal Link

Paramètres

Nom Type Requis Description
tenantId string Oui
userId string Non

Réponse

Retourne : GetSubscriptionsAPIResponse


obtenir les utilisations quotidiennes du locataire Internal Link

Paramètres

Nom Type Obligatoire Description
tenantId string Oui
yearNumber number Non
monthNumber number Non
dayNumber number Non
skip number Non

Réponse

Renvoie: GetTenantDailyUsages200Response

Exemple

Exemple de getTenantDailyUsages
Copy Copy
1
2const tenantId: string = "tenant_89f3c2-prod";
3const yearNumber: number = 2026;
4const monthNumber: number = 1;
5const skip: number = 0;
6const usages: GetTenantDailyUsages200Response = await getTenantDailyUsages(tenantId, yearNumber, monthNumber, undefined, skip);
7

créer un forfait pour le locataire Internal Link

Paramètres

Name Type Required Description
tenantId string Oui
createTenantPackageBody CreateTenantPackageBody Oui

Réponse

Renvoie : CreateTenantPackage200Response

Exemple

Exemple de createTenantPackage
Copy Copy
1
2const tenantId: string = "tenant_7f3b1a9c";
3const tenantPackage: TenantPackage = { id: "pkg_001", name: "Premium Plan", seats: 100 };
4const customConfig: CustomConfigParameters = { enableImages: true, maxImageSizeMb: 10 };
5const createTenantPackageBody: CreateTenantPackageBody = {
6 packageName: "Premium Plus",
7 tenantPackage,
8 customConfig,
9 notes: "Enable advanced moderation and image uploads" // paramètre optionnel démontré
10};
11const result: CreateTenantPackage200Response = await createTenantPackage(tenantId, createTenantPackageBody);
12

supprimer le forfait du locataire Internal Link

Paramètres

Nom Type Requis Description
tenantId string Oui
id string Oui

Réponse

Renvoie: FlagCommentPublic200Response

Exemple

Exemple de deleteTenantPackage
Copy Copy
1
2const tenantId: string = 'fc-tenant-8a9c2b';
3const packageId: string = 'pkg-47f3c9';
4const result: FlagCommentPublic200Response = await deleteTenantPackage(tenantId, packageId);
5

obtenir le forfait du locataire Internal Link

Paramètres

Nom Type Requis Description
tenantId string Oui
id string Oui

Réponse

Renvoie: GetTenantPackage200Response

Exemple

Exemple getTenantPackage
Copy Copy
1
2const tenantId: string = 'tenant_westus_01';
3const packageId: string = 'pkg_premium_annual_2026';
4interface FetchOptions { includeArchived?: boolean }
5const options: FetchOptions = { includeArchived: false };
6const result: GetTenantPackage200Response = await getTenantPackage(tenantId, packageId);
7

obtenir les forfaits du locataire Internal Link

Paramètres

Nom Type Obligatoire Description
tenantId string Oui
skip number Non

Réponse

Renvoie: GetTenantPackages200Response

Exemple

Exemple getTenantPackages
Copy Copy
1
2const tenantId: string = 'tenant_4f3a9c2d';
3const skip: number = 25;
4const packagesResponse: GetTenantPackages200Response = await getTenantPackages(tenantId);
5const pagedPackagesResponse: GetTenantPackages200Response = await getTenantPackages(tenantId, skip);
6

remplacer le forfait du locataire Internal Link

Paramètres

Name Type Obligatoire Description
tenantId string Oui
id string Oui
replaceTenantPackageBody ReplaceTenantPackageBody Oui

Réponse

Renvoie : FlagCommentPublic200Response

Exemple

Exemple de replaceTenantPackage
Copy Copy
1
2const tenantId: string = 'tenant-9b72f2';
3const packageId: string = 'pkg-prod-v2';
4const replaceTenantPackageBody: ReplaceTenantPackageBody = {
5 name: 'Premium Moderation Bundle',
6 enabled: true,
7 maxModerators: 4,
8 // les champs optionnels comme "notes" ou "trialExpiry" sont intentionnellement omis ici
9} as ReplaceTenantPackageBody;
10const result: FlagCommentPublic200Response = await replaceTenantPackage(
11 tenantId,
12 packageId,
13 replaceTenantPackageBody
14);
15

mettre à jour le forfait du locataire Internal Link

Paramètres

Name Type Requis Description
tenantId string Oui
id string Oui
updateTenantPackageBody UpdateTenantPackageBody Oui

Réponse

Renvoie : FlagCommentPublic200Response

Exemple

Exemple de updateTenantPackage
Copy Copy
1
2const tenantId: string = 'tenant_8a4f1c9b';
3const packageId: string = 'pkg_premium_v2';
4const customConfig: CustomConfigParameters = { enableRichText: true, maxImagesPerComment: 5 };
5const updateTenantPackageBody: UpdateTenantPackageBody = {
6 name: 'Premium Moderation Package',
7 enabled: true,
8 description: 'Adds advanced spam rules, image moderation and priority support',
9 customConfigParameters: customConfig
10};
11const result: FlagCommentPublic200Response = await updateTenantPackage(tenantId, packageId, updateTenantPackageBody);
12

créer un utilisateur du locataire Internal Link

Paramètres

Nom Type Requis Description
tenantId string Oui
createTenantUserBody CreateTenantUserBody Oui

Réponse

Renvoie : CreateTenantUser200Response

Exemple

Exemple de createTenantUser
Copy Copy
1
2const tenantId: string = "tenant_9a8c7e4b";
3const createTenantUserBody: CreateTenantUserBody = {
4 email: "julia.smith@acme-corp.com",
5 displayName: "Julia Smith",
6 role: "moderator",
7 password: "Str0ngP@ssword!23",
8 sendInviteEmail: true, // paramètre optionnel démontré
9 locale: "en-US",
10 metadata: { department: "Customer Success" }
11};
12const result: CreateTenantUser200Response = await createTenantUser(tenantId, createTenantUserBody);
13

supprimer l'utilisateur du locataire Internal Link

Paramètres

Nom Type Obligatoire Description
tenantId string Oui
id string Oui
deleteComments string Non
commentDeleteMode string Non

Réponse

Renvoie: FlagCommentPublic200Response

Exemple

Exemple de deleteTenantUser
Copy Copy
1
2const tenantId: string = 'tenant_8f3b2a9c';
3const id: string = 'user_4e5f6a7b';
4const deleteComments: string = 'true';
5const commentDeleteMode: string = 'hard';
6
7const result: FlagCommentPublic200Response = await deleteTenantUser(tenantId, id, deleteComments, commentDeleteMode);
8

obtenir l'utilisateur du locataire Internal Link

Paramètres

Name Type Requis Description
tenantId string Oui
id string Oui

Réponse

Renvoie : GetTenantUser200Response

Exemple

Exemple de getTenantUser
Copy Copy
1
2const tenantId: string = "tenant_9f7d4b2a-1c3e";
3const id: string = "user_6a12b3c4d5";
4const includeProfile: boolean | undefined = true; // exemple de paramètre optionnel
5const response: GetTenantUser200Response = await getTenantUser(tenantId, id);
6console.log("Tenant user fetched", response);
7

obtenir les utilisateurs du locataire Internal Link

Paramètres

Nom Type Obligatoire Description
tenantId string Oui
skip number Non

Réponse

Renvoie : GetTenantUsers200Response

Exemple

Exemple de getTenantUsers
Copy Copy
1
2const tenantId: string = 'tenant_8f3b2c1a';
3const skip: number = 50;
4const firstPage: GetTenantUsers200Response = await getTenantUsers(tenantId);
5const nextPage: GetTenantUsers200Response = await getTenantUsers(tenantId, skip);
6

remplacer l'utilisateur du locataire Internal Link

Paramètres

Name Type Requis Description
tenantId string Oui
id string Oui
replaceTenantUserBody ReplaceTenantUserBody Oui
updateComments string Non

Réponse

Renvoie : FlagCommentPublic200Response

Exemple

Exemple de replaceTenantUser
Copy Copy
1
2const tenantId: string = "tenant_5f8b9a";
3const id: string = "user_92bf21";
4const replaceTenantUserBody: ReplaceTenantUserBody = {
5 email: "jane.doe@acme-corp.com",
6 displayName: "Jane Doe",
7 externalId: "acme|12345",
8 roles: ["commenter", "moderator"],
9 isActive: true,
10 metadata: { team: "product", location: "NYC" }
11};
12const updateComments: string = "Update historical comments to reflect new display name";
13const result: FlagCommentPublic200Response = await replaceTenantUser(tenantId, id, replaceTenantUserBody, updateComments);
14

Paramètres

Nom Type Requis Description
tenantId string Oui
id string Oui
redirectURL string Non

Réponse

Renvoie : FlagCommentPublic200Response

Exemple

Exemple de sendLoginLink
Copy Copy
1
2const tenantId: string = 'tenant_acme_01';
3const id: string = 'user_9f3b2a';
4const redirectURL: string = 'https://app.example.com/onboard?source=login-email';
5const result: FlagCommentPublic200Response = await sendLoginLink(tenantId, id, redirectURL);
6

mettre à jour l'utilisateur du locataire Internal Link

Paramètres

Nom Type Obligatoire Description
tenantId string Oui
id string Oui
updateTenantUserBody UpdateTenantUserBody Oui
updateComments string Non

Réponse

Renvoie : FlagCommentPublic200Response

Exemple

Exemple de updateTenantUser
Copy Copy
1
2const tenantId: string = 'tenant_84f3b2';
3const id: string = 'user_7a9d1c';
4const updateComments: string = 'Promoted to moderator and updated contact email';
5const updateTenantUserBody: UpdateTenantUserBody = {
6 email: 'jane.doe+mod@example.com',
7 displayName: 'Jane D.',
8 roles: ['moderator'],
9 isBanned: false,
10 metadata: { department: 'community' }
11};
12const result: FlagCommentPublic200Response = await updateTenantUser(tenantId, id, updateTenantUserBody, updateComments);
13

créer un locataire Internal Link

Paramètres

Nom Type Requis Description
tenantId string Oui
createTenantBody CreateTenantBody Oui

Réponse

Retourne : CreateTenant200Response

Exemple

Exemple de createTenant
Copy Copy
1
2const tenantId: string = "acme-corporation";
3const billing: BillingInfo = { planId: "pro", billingContactEmail: "finance@acme-corp.com", currency: "USD" };
4const domainConfig: APIDomainConfiguration = { primaryDomain: "comments.acme-corp.com", allowedDomains: ["acme-corp.com", "www.acme-corp.com"], enforceHttps: true };
5const importedSites: ImportedSiteType[] = [{ siteId: "site-001", url: "https://blog.acme-corp.com", name: "Acme Blog" }]; // optionnel
6const createBody: CreateTenantBody = { tenantName: "Acme Corporation", adminEmail: "admin@acme-corp.com", billingInfo: billing, domainConfiguration: domainConfig, importedSites, enableModeration: true };
7const response: CreateTenant200Response = await createTenant(tenantId, createBody);
8

supprimer le locataire Internal Link

Paramètres

Name Type Required Description
tenantId string Oui
id string Oui
sure string Non

Réponse

Retourne: FlagCommentPublic200Response

Exemple

Exemple de deleteTenant
Copy Copy
1
2const tenantId: string = "tenant_7b3f1a9e";
3const id: string = "flag_9c4d2b1a";
4const sure: string = "yes_confirm_delete";
5
6const result: FlagCommentPublic200Response = await deleteTenant(tenantId, id, sure);
7console.log(result);
8

obtenir le locataire Internal Link

Paramètres

Nom Type Obligatoire Description
tenantId string Oui
id string Oui

Réponse

Retourne : GetTenant200Response

Exemple

Exemple de getTenant
Copy Copy
1
2const tenantId: string = "tenant_acme_corp";
3const id: string = "f47ac10b-58cc-4372-a567-0e02b2c3d479";
4interface GetOptions { includeDeleted?: boolean; locale?: string; }
5const options: GetOptions = { locale: "en-US" };
6const result: GetTenant200Response = await getTenant(tenantId, id);
7

obtenir les locataires Internal Link

Paramètres

Nom Type Obligatoire Description
tenantId string Oui
meta string Non
skip number Non

Réponse

Renvoie : GetTenants200Response

Exemple

Exemple de getTenants
Copy Copy
1
2(async () => {
3 const tenantId: string = 'tenant_9f2d1b7c';
4 const meta: string = 'include=domains,billing,customConfig';
5 const skip: number = 20;
6 const response: GetTenants200Response = await getTenants(tenantId, meta, skip);
7 console.log(response);
8})();
9

mettre à jour le locataire Internal Link

Paramètres

Nom Type Obligatoire Description
tenantId string Oui
id string Oui
updateTenantBody UpdateTenantBody Oui

Réponse

Retourne: FlagCommentPublic200Response

Exemple

Exemple de updateTenant
Copy Copy
1
2const tenantId: string = "tenant_01H4ZQ7KABCD";
3const id: string = "site_9f8e7d6c";
4const apiDomainConfiguration: APIDomainConfiguration = {
5 primaryDomain: "comments.acme.com",
6 allowSubdomains: true
7};
8const billingInfo: BillingInfo = {
9 planName: "Business",
10 billingContactEmail: "billing@acme.com",
11 seats: 25
12};
13const updateTenantBody: UpdateTenantBody = {
14 displayName: "Acme Corporation Comments",
15 apiDomainConfiguration,
16 billingInfo, // paramètre optionnel démontré
17 enableModeration: true
18};
19const result: FlagCommentPublic200Response = await updateTenant(tenantId, id, updateTenantBody);
20

téléverser une image Internal Link


Téléverser et redimensionner une image

Paramètres

Nom Type Requis Description
tenantId string Oui
file Blob Oui
sizePreset SizePreset Non
urlId string Non

Réponse

Renvoie: UploadImageResponse


obtenir la progression du badge utilisateur par ID Internal Link


Paramètres

Nom Type Requis Description
tenantId string Oui
id string Oui

Réponse

Renvoie: GetUserBadgeProgressById200Response


obtenir la progression du badge utilisateur par ID d'utilisateur Internal Link

Paramètres

Nom Type Obligatoire Description
tenantId string Oui
userId string Oui

Réponse

Retourne: GetUserBadgeProgressById200Response


obtenir la liste de progression des badges utilisateur Internal Link

Paramètres

Nom Type Requis Description
tenantId string Oui
userId string Non
limit number Non
skip number Non

Réponse

Renvoie : GetUserBadgeProgressList200Response


créer un badge utilisateur Internal Link

Paramètres

Nom Type Requis Description
tenantId string Oui
createUserBadgeParams CreateUserBadgeParams Oui

Réponse

Retourne : CreateUserBadge200Response


supprimer le badge utilisateur Internal Link


Paramètres

Nom Type Requis Description
tenantId string Oui
id string Oui

Réponse

Retourne : UpdateUserBadge200Response


obtenir le badge utilisateur Internal Link


Paramètres

Nom Type Obligatoire Description
tenantId string Oui
id string Oui

Réponse

Renvoie : GetUserBadge200Response


obtenir les badges utilisateur Internal Link

Paramètres

Nom Type Obligatoire Description
tenantId string Oui
userId string Non
badgeId string Non
type number Non
displayedOnComments boolean Non
limit number Non
skip number Non

Réponse

Renvoie: GetUserBadges200Response


mettre à jour le badge utilisateur Internal Link


Paramètres

Nom Type Obligatoire Description
tenantId string Oui
id string Oui
updateUserBadgeParams UpdateUserBadgeParams Oui

Réponse

Renvoie: UpdateUserBadge200Response


obtenir le nombre de notifications de l'utilisateur Internal Link


Paramètres

Nom Type Obligatoire Description
tenantId string Oui
sso string Non

Réponse

Renvoie: GetUserNotificationCount200Response


obtenir les notifications de l'utilisateur Internal Link

Paramètres

Nom Type Requis Description
tenantId string Oui
pageSize number Non
afterId string Non
includeContext boolean Non
afterCreatedAt number Non
unreadOnly boolean Non
dmOnly boolean Non
noDm boolean Non
includeTranslations boolean Non
sso string Non

Réponse

Renvoie : GetUserNotifications200Response


réinitialiser le nombre de notifications de l'utilisateur Internal Link


Paramètres

Nom Type Obligatoire Description
tenantId string Oui
sso string Non

Réponse

Retourne: ResetUserNotifications200Response


réinitialiser les notifications de l'utilisateur Internal Link

Paramètres

Nom Type Obligatoire Description
tenantId string Oui
afterId string Non
afterCreatedAt number Non
unreadOnly boolean Non
dmOnly boolean Non
noDm boolean Non
sso string Non

Réponse

Retourne : ResetUserNotifications200Response


mettre à jour le statut d'abonnement aux commentaires de notification de l'utilisateur Internal Link

Activer ou désactiver les notifications pour un commentaire spécifique.

Paramètres

Nom Type Requis Description
tenantId string Oui
notificationId string Oui
optedInOrOut UpdateUserNotificationCommentSubscriptionStatusOptedInOrOutEnum Oui
commentId string Oui
sso string Non

Réponse

Retourne : UpdateUserNotificationStatus200Response


mettre à jour le statut d'abonnement aux pages de notification de l'utilisateur Internal Link

Activer ou désactiver les notifications pour une page. Lorsque des utilisateurs sont abonnés à une page, des notifications sont créées pour les nouveaux commentaires racines, et aussi

Paramètres

Nom Type Requis Description
tenantId string Oui
urlId string Oui
url string Oui
pageTitle string Oui
subscribedOrUnsubscribed UpdateUserNotificationPageSubscriptionStatusSubscribedOrUnsubscribedEnum Oui
sso string Non

Réponse

Retourne: UpdateUserNotificationStatus200Response

mettre à jour le statut de notification de l'utilisateur Internal Link


Paramètres

Nom Type Requis Description
tenantId string Oui
notificationId string Oui
newStatus UpdateUserNotificationStatusNewStatusEnum Oui
sso string Non

Réponse

Renvoie: UpdateUserNotificationStatus200Response


obtenir les statuts de présence des utilisateurs Internal Link

Paramètres

Nom Type Requis Description
tenantId string Oui
urlIdWS string Oui
userIds string Oui

Réponse

Retourne : GetUserPresenceStatuses200Response


rechercher des utilisateurs Internal Link

Paramètres

Nom Type Requis Description
tenantId string Oui
urlId string Oui
usernameStartsWith string Oui
mentionGroupIds Array Non
sso string Non

Réponse

Retourne : SearchUsers200Response


obtenir l'utilisateur Internal Link

Paramètres

Nom Type Obligatoire Description
tenantId string Oui
id string Oui

Réponse

Renvoie : GetUser200Response

Exemple

Exemple d'utilisation de getUser
Copy Copy
1
2const tenantId: string = "acme-publishing-42";
3const userIdOptional: string | undefined = "user_9d7b4c"; // peut être indéfini dans certains flux (optionnel)
4const id: string = userIdOptional ?? "user_default_0001";
5const result: GetUser200Response = await getUser(tenantId, id);
6console.log(result);
7

créer un vote Internal Link

Paramètres

Nom Type Requis Description
tenantId string Oui
commentId string Oui
direction CreateVoteDirectionEnum Oui
userId string Non
anonUserId string Non

Réponse

Renvoie: VoteComment200Response

Exemple

Exemple de createVote
Copy Copy
1
2(async () => {
3 const tenantId: string = 'acme-tenant-812';
4 const commentId: string = '5e8f8b7a-3d4b-4f1b-9a2e-1c9f2d6a7b8c';
5 const direction: CreateVoteDirectionEnum = CreateVoteDirectionEnum.UP;
6 const anonUserId: string = 'anon-84b9c2d';
7 const voteResult: VoteComment200Response = await createVote(tenantId, commentId, direction, undefined, anonUserId);
8 console.log(voteResult);
9})();
10

supprimer le vote Internal Link

Paramètres

Nom Type Requis Description
tenantId string Oui
id string Oui
editKey string Non

Réponse

Renvoie : DeleteCommentVote200Response

Exemple

Exemple de deleteVote
Copy Copy
1
2const tenantId: string = 'tenant_7f3b21c9';
3const id: string = 'vote_4a2d9f1b';
4const editKey: string = 'edit_92b7c6a1';
5
6const resultWithoutEditKey: DeleteCommentVote200Response = await deleteVote(tenantId, id);
7const resultWithEditKey: DeleteCommentVote200Response = await deleteVote(tenantId, id, editKey);
8

obtenir les votes Internal Link

Paramètres

Name Type Required Description
tenantId string Oui
urlId string Oui

Réponse

Renvoie: GetVotes200Response

Exemple

Exemple de getVotes
Copy Copy
1
2const tenantId: string = 'tenant_9f8b3c_prod';
3const urlId: string = '/news/2026/typescript-ecosystem-update';
4const votes: GetVotes200Response = await getVotes(tenantId, urlId);
5// Si un paramètre optionnel existait, par exemple includeHidden, il pourrait être utilisé comme :
6// const votesWithHidden: GetVotes200Response = await getVotes(tenantId, urlId, { includeHidden: true });
7

obtenir les votes pour l'utilisateur Internal Link

Paramètres

Nom Type Requis Description
tenantId string Oui
urlId string Oui
userId string Non
anonUserId string Non

Réponse

Renvoie: GetVotesForUser200Response

Exemple

Exemple de getVotesForUser
Copy Copy
1
2const tenantId: string = 'tenant_acme_01';
3const urlId: string = 'news/2026/01/12/product-launch';
4const userId: string = 'user_9c3f2b';
5const anonUserId: string = 'anon_d4e7a1';
6
7const votesForUser: GetVotesForUser200Response = await getVotesForUser(tenantId, urlId, userId);
8const votesForAnon: GetVotesForUser200Response = await getVotesForUser(tenantId, urlId, undefined, anonUserId);
9

Besoin d'aide?

Si vous rencontrez des problèmes ou avez des questions concernant le SDK JavaScript/TypeScript, veuillez :

Contribution

Les contributions sont les bienvenues ! Veuillez consulter le dépôt GitHub pour les directives de contribution.