FastComments.com

FastComments JavaScript/TypeScript SDK


Ово је званични JavaScript/TypeScript SDK за FastComments.

Управљајте коментарима, корисницима, SSO, и модерацијом из Node.js-а или из прегледача.

Репозиторијум

Погледајте на GitHub


Инсталација Internal Link

npm

npm install fastcomments-sdk

API документација Internal Link


Пуна API референца: docs/api/README.md

Компатибилност прегледача и сервера Internal Link


Ovaj SDK koristi dualne ulazne tačke како би обезбедио оптималну компатибилност и спречио грешке при извршавању:

  • fastcomments-sdk/browser - Верзија сигурна за прегледаче која користи уграђени fetch
  • fastcomments-sdk/server - Пуна Node.js верзија са подршком за SSO
  • fastcomments-sdk (подразумевано) - Само типови, безбедно за увоз било где

Јавни и заштићени API-ји Internal Link

SDK пружа три главне API класе:

  • DefaultApi - Заштићени крајњи пункти који захтевају ваш API кључ за аутентификацију. Користите их за операције на серверској страни.
  • PublicApi - Јавни крајњи пункти који су доступни без API кључа. Могу се позивати директно из прегледача/мобилних уређаја/итд.
  • HiddenApi - Интерни/админ крајњи пункти за напредне случајеве употребе.

Пример: Коришћење Public API (безбедно за прегледач)

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

const publicApi = new PublicApi();

// Добијање коментара за страницу (API кључ није потребан)
const response = await publicApi.getCommentsPublic({
  tenantId: 'your-tenant-id',
  urlId: 'page-url-id'
});

Пример: Коришћење Default API (само на серверу)

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

const config = new Configuration({
  apiKey: 'your-api-key' // Чувајте ово у тајности!
});
const defaultApi = new DefaultApi(config);

// Добијање коментара са пуном админ приступом
const response = await defaultApi.getComments({
  tenantId: 'your-tenant-id',
  urlId: 'page-url-id'
});

SSO (једнократно пријављивање) интеграција Internal Link

FastComments подржава SSO за интеграцију са вашим постојећим системом аутентификације корисника. SSO функционалност је доступна само у серверском експорту јер захтева Node.js crypto могућности.

Једноставан SSO (само серверска страна)

Једноставан SSO треба да се генерише на серверу и пошаље клијенту:

// Код на серверу (Node.js/бекенд)
import { FastCommentsSSO, PublicApi } from 'fastcomments-sdk/server';

// Направите једноставан SSO користећи уграђеног помоћника  
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();

// Пошаљите ssoToken у код на клијентској страни
// Код на клијентској страни може затим да користи овај токен са SDK-ом за прегледач

Сигуран SSO (серверска страна, препоручено)

Сигуран SSO треба да се имплементира на серверу и пружа бољу безбедност:

// Код на серверу (Node.js/бекенд)
import { FastCommentsSSO, PublicApi } from 'fastcomments-sdk/server';

// Направите сигуран SSO користећи уграђеног помоћника
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();

// Користите са API позивима на серверу
const publicApi = new PublicApi();
const response = await publicApi.getCommentsPublic({
  tenantId: 'your-tenant-id',
  urlId: 'page-url-id',
  sso: JSON.stringify(ssoConfig)
});

// Или пошаљите ssoConfig клијенту за употребу у прегледачу

Коришћење SSO у прегледачу (са сервером-генерисаним токеном)

// Код на клијентској страни (прегледач)
import { PublicApi } from 'fastcomments-sdk/browser';

// Преузмите SSO токен са вашег серверског ендпоинта
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 // Користите SSO токен генерисан на серверу
});

SSO са креирањем коментара

// Серверска страна: креирајте SSO и коментар
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)
});

Уобичајени случајеви употребе Internal Link

Добијање коментара за страницу

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

Креирање коментара

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

Гласање за коментар

const voteResponse = await sdk.publicApi.voteComment({
  voteBodyParams: {
    commentId: 'comment-id',
    direction: 1 // 1 за позитиван глас, -1 за негативан глас
  }
});

Управљање корисницима (захтева API кључ)

// Претрага корисника (захтева DefaultApi)
const users = await sdk.defaultApi.searchUsers({
  tenantId: 'your-tenant-id',
  urlId: 'page-id',
  usernameStartsWith: 'john'
});

Догађаји уживо (ажурирања у реалном времену) Internal Link

Pretplatite se na događaje uživo da biste dobili ažuriranja u realnom vremenu za komentare, glasove i druge aktivnosti.

Događaji na nivou stranice

Slušajte događaje uživo na određenoj stranici (komentari, glasovi, itd.):

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

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

// Pretplatite se na događaje uživo za stranicu
const subscription = subscribeToChanges(
  config,
  'your-tenant-id', // tenantIdWS
  'page-url-id',    // urlIdWS  
  'user-session-id', // userIdWS (dohvatite ovo iz odgovora getComments)
  (event: LiveEvent) => {
    console.log('Live event received:', event);
    
    switch (event.type) {
      case LiveEventType.new_comment:
        console.log('New comment:', event.comment);
        // Ažurirajte vaš korisnički interfejs sa novim komentarom
        break;
      case LiveEventType.new_vote:
        console.log('New vote:', event.vote);
        // Ažurirajte broj glasova u vašem korisničkom interfejsu
        break;
      case LiveEventType.updated_comment:
        console.log('Comment updated:', event.comment);
        break;
      default:
        console.log('Other event type:', event.type);
    }
    
    return true; // Vrati true ako je događaj obrađen
  },
  (isConnected: boolean) => {
    console.log('Connection status:', isConnected ? 'Connected' : 'Disconnected');
  }
);

// Zatvorite pretplatu kada završite
subscription.close();

Pretplata na događaje korisnika

Slušajte događaje specifične za korisnika (obaveštenja, pominjanja, itd.):

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

const userConfig = {
  userIdWS: 'user-session-id', // Dohvatite ovo iz odgovora getComments
};

// Pretplatite se na lični feed korisnika
const userSubscription = subscribeToUserFeed(
  userConfig,
  (event: LiveEvent) => {
    console.log('User event received:', event);
    
    switch (event.type) {
      case LiveEventType.notification:
        console.log('New notification:', event.notification);
        // Prikažite obaveštenje u vašem korisničkom interfejsu
        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');
  }
);

// Zatvorite kada završite
userSubscription.close();

Kako dobiti userIdWS

Parametar userIdWS je obavezan za događaje uživo i može se dobiti iz odgovora API-ja:

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

// Izvucite userIdWS iz odgovora
const userIdWS = response.data?.userSessionInfo?.userIdWS;

if (userIdWS) {
  // Sada se možete pretplatiti na događaje uživo
  const subscription = subscribeToChanges(config, tenantIdWS, urlIdWS, userIdWS, handleEvent);
}

ИД-ови емитовања Internal Link

Videćete da treba da prosledite broadcastId u nekim API pozivima. Kada primite događaje, dobićete ovaj ID nazad, tako da ćete znati da ignorišete događaj ako planirate optimistično primeniti promene na klijentu (što verovatno želite, jer pruža najbolje iskustvo). Ovde prosledite UUID. ID treba biti dovoljno jedinstven da se ne pojavi dva puta tokom sesije pregledača.

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() // Jedinstveni ID za ovu operaciju
  }
});

Обрада грешака 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);
  }
}

aggregate Internal Link

Агрегира документе груписањем (ако је groupBy наведен) и примењујући више операција. Подржане су различите операције (нпр. sum, countDistinct, avg итд.).

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
aggregationRequestAggregationRequestДа
parentTenantIdstringНе
includeStatsbooleanНе

Одговор

Враћа: AggregationResponse


getAuditLogs Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
limitnumberНе
skipnumberНе
orderSORTDIRНе
afternumberНе
beforenumberНе

Одговор

Враћа: GetAuditLogs200Response

Пример

Пример getAuditLogs
Copy Copy
1
2const tenantId: string = 'tenant_9a8b7c';
3const limit: number = 100;
4const skip: number = 0;
5const after: number = Date.now() - 30 * 24 * 60 * 60 * 1000; // пре 30 дана
6const before: number = Date.now();
7const auditLogs: GetAuditLogs200Response = await getAuditLogs(tenantId, limit, skip, undefined, after, before);
8

blockFromCommentPublic Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
commentIdstringДа
publicBlockFromCommentParamsPublicBlockFromCommentParamsДа
ssostringНе

Одговор

Враћа: BlockFromCommentPublic200Response

Пример

Пример blockFromCommentPublic
Copy Copy
1
2const tenantId: string = "site_7f9b2e";
3const commentId: string = "comment_2026-03-25_001";
4const publicBlockFromCommentParams: PublicBlockFromCommentParams = {
5 reason: "Repeated harassment and targeted abuse",
6 blockDurationDays: 90,
7 includeHistory: true,
8 notifyModeratorTeam: true
9};
10const sso: string = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.fakePayload.signature";
11const result: BlockFromCommentPublic200Response = await blockFromCommentPublic(tenantId, commentId, publicBlockFromCommentParams, sso);
12

unBlockCommentPublic Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
commentIdstringДа
publicBlockFromCommentParamsPublicBlockFromCommentParamsДа
ssostringНе

Одговор

Враћа: UnBlockCommentPublic200Response

Пример

Пример unBlockCommentPublic
Copy Copy
1
2const tenantId: string = 'tenant_42e8a1';
3const commentId: string = 'cmt_9b3f2d';
4const publicBlockFromCommentParams: PublicBlockFromCommentParams = {
5 reason: 'abusive_language',
6 blockedByModeratorId: 'mod_17',
7 note: 'Targeted harassment; review complete',
8 unblockRequestedAt: new Date().toISOString()
9};
10const sso: string = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.example.signature';
11const result: UnBlockCommentPublic200Response = await unBlockCommentPublic(tenantId, commentId, publicBlockFromCommentParams, sso);
12

checkedCommentsForBlocked Internal Link

Параметри

NameTypeRequiredDescription
tenantIdstringДа
commentIdsstringДа
ssostringНе

Одговор

Враћа: CheckedCommentsForBlocked200Response

Пример

checkedCommentsForBlocked Пример
Copy Copy
1
2const tenantId: string = 'tenant_4f3b2a1e';
3const commentIds: string = 'c_1001,c_1002,c_1003';
4const ssoToken: string = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ1c2VyMTIzIn0.Sf4ke7nQP3mZx9v2';
5
6const resultWithoutSSO: CheckedCommentsForBlocked200Response = await checkedCommentsForBlocked(tenantId, commentIds);
7const resultWithSSO: CheckedCommentsForBlocked200Response = await checkedCommentsForBlocked(tenantId, commentIds, ssoToken);
8

blockUserFromComment Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
idstringДа
blockFromCommentParamsBlockFromCommentParamsДа
userIdstringНе
anonUserIdstringНе

Одговор

Враћа: BlockFromCommentPublic200Response

Пример

Пример blockUserFromComment
Copy Copy
1
2const tenantId: string = 'acme-corp';
3const id: string = 'comment_7f3b2a9c';
4const blockFromCommentParams: BlockFromCommentParams = {
5 reason: 'Repeated abusive language and targeted harassment',
6 durationDays: 90,
7 preventReposting: true
8};
9const userId: string = 'user_12345';
10const anonUserId: string = 'anon_98765';
11
12const result: BlockFromCommentPublic200Response = await blockUserFromComment(
13 tenantId,
14 id,
15 blockFromCommentParams,
16 userId,
17 anonUserId
18);
19

createCommentPublic Internal Link

Параметри

НазивТипОбавезноОпис
tenantIdstringДа
urlIdstringДа
broadcastIdstringДа
commentDataCommentDataДа
sessionIdstringНе
ssostringНе

Одговор

Враћа: CreateCommentPublic200Response

Пример

Пример createCommentPublic
Copy Copy
1
2const tenantId: string = 'tenant_prod_42';
3const urlId: string = 'article-2026-03-25-tech-deep-dive';
4const broadcastId: string = 'live-broadcast-001';
5const sessionId: string = 'sess_9f8e7d6a3b';
6const sso: string = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.example.signature';
7const commentData: CommentData = {
8 content: 'Great reporting — appreciated the depth on performance tradeoffs.',
9 authorName: 'Jordan M.',
10 language: 'en-US',
11 metadata: { client: 'web' }
12};
13const result: CreateCommentPublic200Response = await createCommentPublic(tenantId, urlId, broadcastId, commentData, sessionId, sso);
14

deleteComment Internal Link

Параметри

НазивТипОбавезноОпис
tenantIdstringДа
idstringДа
contextUserIdstringНе
isLivebooleanНе

Одговор

Враћа: DeleteComment200Response

Пример

Пример за deleteComment
Copy Copy
1
2const tenantId: string = "tenant_acme_01";
3const id: string = "comment_5f3a2b7c";
4const contextUserId: string = "user_1229";
5const isLive: boolean = true;
6const response: DeleteComment200Response = await deleteComment(tenantId, id, contextUserId, isLive);
7

deleteCommentPublic Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
commentIdstringДа
broadcastIdstringДа
editKeystringНе
ssostringНе

Одговор

Враћа: DeleteCommentPublic200Response

Пример

Пример deleteCommentPublic
Copy Copy
1
2const tenantId: string = 'tenant_4f2c9b';
3const commentId: string = 'comment-7c3a9f2d';
4const broadcastId: string = 'article-2026-03-20';
5const editKey: string | undefined = 'ek_pub_abc12345';
6const sso: string | undefined = 'sso_eyJhbGciOiJIUzI1Ni';
7
8const result: DeleteCommentPublic200Response = await deleteCommentPublic(
9 tenantId,
10 commentId,
11 broadcastId,
12 editKey,
13 sso
14);
15

deleteCommentVote Internal Link

Параметри

NameTypeRequiredDescription
tenantIdstringДа
commentIdstringДа
voteIdstringДа
urlIdstringДа
broadcastIdstringДа
editKeystringНе
ssostringНе

Одговор

Враћа: DeleteCommentVote200Response

Пример

deleteCommentVote Пример
Copy Copy
1
2const tenantId: string = 'acme-tenant-87e4fd';
3const commentId: string = 'cmt-9a12b3f4';
4const voteId: string = 'vote-4f6d21b9';
5const urlId: string = 'https://www.acme.com/articles/2026/03/25/how-to-test';
6const broadcastId: string = 'broadcast-20260325-01';
7const editKey: string = 'editkey-6b7c8d9e';
8const sso: string = 'sso-jwt-eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9';
9
10const response: DeleteCommentVote200Response = await deleteCommentVote(
11 tenantId,
12 commentId,
13 voteId,
14 urlId,
15 broadcastId,
16 editKey,
17 sso
18);
19

flagComment Internal Link

Параметри

ИмеТипПотребноОпис
tenantIdstringДа
idstringДа
userIdstringНе
anonUserIdstringНе

Одговор

Враћа: FlagComment200Response

Пример

flagComment пример
Copy Copy
1
2const tenantId: string = 'tenant_7f3b21';
3const commentId: string = 'cmt_9a2b4';
4const userId: string = 'user_1024';
5const result: FlagComment200Response = await flagComment(tenantId, commentId, userId);
6

getComment Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
idstringДа

Одговор

Враћа: GetComment200Response

Пример

getComment Пример
Copy Copy
1
2const tenantId: string = "acme-publishing-001";
3const commentId: string = "f3b2c1d0-9a8e-4b7c-8123-6d5f0a1e2b3c";
4const result: GetComment200Response = await getComment(tenantId, commentId);
5const wrapper: GetComment200Response & { comment?: APIComment } = result;
6const comment: APIComment | undefined = wrapper.comment;
7const authorBadge: CommentUserBadgeInfo | undefined = comment?.user?.badge;
8const userHashTags: CommentUserHashTagInfo[] | undefined = comment?.user?.hashTags
9

getComments Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
pagenumberНе
limitnumberНе
skipnumberНе
asTreebooleanНе
skipChildrennumberНе
limitChildrennumberНе
maxTreeDepthnumberНе
urlIdstringНе
userIdstringНе
anonUserIdstringНе
contextUserIdstringНе
hashTagstringНе
parentIdstringНе
directionSortDirectionsНе

Одговор

Враћа: GetComments200Response

Пример

Пример getComments
Copy Copy
1
2const tenantId: string = 'tenant_acme_42';
3const response: GetComments200Response = await getComments(
4 tenantId,
5 1, // страница
6 20, // лимит
7 0, // прескочи
8 true, // у виду стабла
9 1, // прескочи подкоментаре
10 3, // ограничење подкоментара
11 4, // максимална дубина стабла
12 'articles/2026/new-product-launch', // ид URL-а
13 'user_7890', // ид корисника
14 'anon_4f3b2', // анонимни ид корисника
15 undefined, // контекстуални ид корисника
16 '#launch', // хештег
17 undefined // ид родитеља
18);
19

getCommentsPublic Internal Link

req tenantId urlId

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
urlIdstringДа
pagenumberНе
directionSortDirectionsНе
ssostringНе
skipnumberНе
skipChildrennumberНе
limitnumberНе
limitChildrennumberНе
countChildrenbooleanНе
fetchPageForCommentIdstringНе
includeConfigbooleanНе
countAllbooleanНе
includei10nbooleanНе
localestringНе
modulesstringНе
isCrawlerbooleanНе
includeNotificationCountbooleanНе
asTreebooleanНе
maxTreeDepthnumberНе
useFullTranslationIdsbooleanНе
parentIdstringНе
searchTextstringНе
hashTagsArrayНе
userIdstringНе
customConfigStrstringНе
afterCommentIdstringНе
beforeCommentIdstringНе

Одговор

Враћа: GetCommentsPublic200Response

Пример

getCommentsPublic пример
Copy Copy
1
2const tenantId: string = 'tenant_eu-west_01';
3const urlId: string = 'https://www.financialtimes.com/articles/2026/market-update-q1';
4const response: GetCommentsPublic200Response = await getCommentsPublic(
5 tenantId,
6 urlId,
7 2,
8 undefined,
9 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.tokenPayload.signature',
10 undefined,
11 0,
12 50,
13 5,
14 true,
15 undefined,
16 true,
17 false,
18 true,
19 'en-US',
20 'reactions,moderation',
21 false,
22 true,
23 true,
24 3,
25 false,
26 undefined,
27 'performance',
28 ['feature','fastcomments'],
29 'user_9876',
30 undefined,
31 undefined,
32 undefined
33);
34

getCommentText Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
commentIdstringДа
editKeystringНе
ssostringНе

Одговор

Враћа: GetCommentText200Response

Пример

Пример getCommentText
Copy Copy
1
2const tenantId: string = 'tenant_acme_001';
3const commentId: string = 'cmt_7890b';
4const editKey: string = 'edit_4f2d9b7c';
5const sso: string = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9';
6
7const result: GetCommentText200Response = await getCommentText(tenantId, commentId, editKey, sso);
8

getCommentVoteUserNames Internal Link

Параметри

НазивТипОбавезноОпис
tenantIdstringДа
commentIdstringДа
dirnumberДа
ssostringНе

Одговор

Враћа: GetCommentVoteUserNames200Response

Пример

Пример getCommentVoteUserNames
Copy Copy
1
2(async () => {
3 const tenantId: string = 'tenant_4f2c1e';
4 const commentId: string = 'cmt_9a7b3d';
5 const dir: number = 1;
6 const resultUpvotes: GetCommentVoteUserNames200Response = await getCommentVoteUserNames(tenantId, commentId, dir);
7 const sso: string = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.fakepayload.signature';
8 const dirDown: number = -1;
9 const resultDownvotes: GetCommentVoteUserNames200Response = await getCommentVoteUserNames(tenantId, commentId, dirDown, sso);
10 console.log(resultUpvotes, resultDownvotes);
11})();
12

lockComment Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
commentIdstringДа
broadcastIdstringДа
ssostringНе

Одговор

Враћа: LockComment200Response

Пример

lockComment Пример
Copy Copy
1
2const tenantId: string = "tenant_prod_8f3a2b";
3const commentId: string = "cmt_5d7e9a92";
4const broadcastId: string = "broadcast_2026_03_25_1400";
5const ssoToken: string = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.example.signature";
6const resultWithSso: LockComment200Response = await lockComment(tenantId, commentId, broadcastId, ssoToken);
7const resultWithoutSso: LockComment200Response = await lockComment(tenantId, commentId, broadcastId);
8

pinComment Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
commentIdstringДа
broadcastIdstringДа
ssostringНе

Одговор

Враћа: PinComment200Response

Пример

pinComment Пример
Copy Copy
1
2const tenantId: string = "tenant_4f2b9a";
3const commentId: string = "cmt_9f8e7d6c";
4const broadcastId: string = "brd_live_concert_2026-03-25";
5const sso: string = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.sso_payload_signature";
6
7const result: PinComment200Response = await pinComment(tenantId, commentId, broadcastId, sso);
8

saveComment Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
createCommentParamsCreateCommentParamsДа
isLivebooleanНе
doSpamCheckbooleanНе
sendEmailsbooleanНе
populateNotificationsbooleanНе

Одговор

Враћа: SaveComment200Response

Пример

saveComment Пример
Copy Copy
1
2const tenantId: string = 'tenant_acme_001';
3const createCommentParams: CreateCommentParams = {
4 content: 'Great article — helped me fix a production issue in minutes.',
5 url: 'https://app.acme.com/blog/performance-tips',
6 author: { name: 'Maya Chen', email: 'maya.chen@acme.com' },
7 metadata: { locale: 'en-US', appVersion: '4.2.1' }
8} as CreateCommentParams;
9const isLive: boolean = true;
10const doSpamCheck: boolean = true;
11const sendEmails: boolean = false;
12const populateNotifications: boolean = true;
13const result: SaveComment200Response = await saveComment(tenantId, createCommentParams, isLive, doSpamCheck, sendEmails, populateNotifications);
14

saveCommentsBulk Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
createCommentParamsArrayДа
isLivebooleanНе
doSpamCheckbooleanНе
sendEmailsbooleanНе
populateNotificationsbooleanНе

Одговор

Враћа: Array<SaveComment200Response

Пример

Пример saveCommentsBulk
Copy Copy
1
2const tenantId: string = 'acme-corp-01';
3const mentions1: CommentUserMentionInfo[] = [{ userId: 'user-123', displayName: 'Jane Doe' }];
4const hashtags1: CommentUserHashTagInfo[] = [{ tag: 'typescript' }];
5const createCommentParams: CreateCommentParams[] = [
6 {
7 content: 'Great insights on async/await patterns.',
8 authorName: 'John Smith',
9 authorEmail: 'john.smith@acme.com',
10 externalId: 'comment-001',
11 createdAt: '2026-03-25T10:15:00Z',
12 userMentions: mentions1,
13 userHashTags: hashtags1
14 },
15 {
16 content: 'I prefer using Promise.all for bulk ops.',
17 authorName: 'Emily Turner',
18 authorEmail: 'emily.turner@acme.com',
19 externalId: 'comment-002',
20 createdAt: '2026-03-25T10:20:00Z'
21 }
22];
23const result: SaveComment200Response[] = await saveCommentsBulk(tenantId, createCommentParams, true, true, false, true);
24

setCommentText Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
commentIdstringДа
broadcastIdstringДа
commentTextUpdateRequestCommentTextUpdateRequestДа
editKeystringНе
ssostringНе

Одговор

Враћа: SetCommentText200Response

Пример

Пример за setCommentText
Copy Copy
1
2const tenantId: string = 'tenant-42';
3const commentId: string = 'cmt-8932';
4const broadcastId: string = 'brd-2023-07';
5const updateRequest: CommentTextUpdateRequest = {
6 text: 'Updated comment text for the product launch — congrats team!',
7 mentions: [{ userId: 'user-17', displayName: 'Ava Nguyen' }] as CommentUserMentionInfo[],
8 hashtags: [{ tag: 'ProductLaunch' }] as CommentUserHashTagInfo[]
9};
10const editKey: string = 'edtk-9f7b';
11const sso: string = 'sso-token-abc123';
12const result: SetCommentText200Response = await setCommentText(tenantId, commentId, broadcastId, updateRequest, editKey, sso);
13

unBlockUserFromComment Internal Link

Параметри

NameTypeRequiredDescription
tenantIdstringДа
idstringДа
unBlockFromCommentParamsUnBlockFromCommentParamsДа
userIdstringНе
anonUserIdstringНе

Одговор

Враћа: UnBlockCommentPublic200Response

Пример

unBlockUserFromComment Пример
Copy Copy
1
2const tenantId: string = 'tenant_87f3e1';
3const id: string = 'comment_9b2a4f';
4const unBlockFromCommentParams: UnBlockFromCommentParams = {
5 reason: 'Reviewed by moderation team — reinstated',
6 moderatorId: 'mod_21',
7 unblockedAt: new Date().toISOString()
8};
9const userId: string = 'user_42';
10const anonUserId: string = 'anon_e7f9';
11const result: UnBlockCommentPublic200Response = await unBlockUserFromComment(tenantId, id, unBlockFromCommentParams, userId, anonUserId);
12

unFlagComment Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
idstringДа
userIdstringНе
anonUserIdstringНе

Одговор

Враћа: FlagComment200Response

Пример

Пример unFlagComment
Copy Copy
1
2const tenantId: string = 'acme-tenant-001';
3const commentId: string = 'cmt_9f8e7d6c';
4const userId: string = 'user_72b4a1c9';
5const anonUserId: string = 'anon_3d2c1b0a';
6const response: FlagComment200Response = await unFlagComment(tenantId, commentId, userId, anonUserId);
7

unLockComment Internal Link

Parametri

NazivTipObaveznoOpis
tenantIdstringDa
commentIdstringDa
broadcastIdstringDa
ssostringNe

Odgovor

Vraća: LockComment200Response

Primer

Primer unLockComment
Copy Copy
1
2const tenantId: string = 'tenant_9d4f2b';
3const commentId: string = 'cmt_8a3e1f';
4const broadcastId: string = 'broadcast_2026_03_25';
5const sso: string = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.example.signature';
6
7const result: LockComment200Response = await unLockComment(tenantId, commentId, broadcastId, sso);
8

unPinComment Internal Link

Параметри

NameTypeRequiredDescription
tenantIdstringYes
commentIdstringYes
broadcastIdstringYes
ssostringNo

Одговор

Враћа: PinComment200Response

Пример

unPinComment Пример
Copy Copy
1
2const tenantId: string = 'tenant_7f9d2a3b';
3const commentId: string = 'comment_842b9c1f';
4const broadcastId: string = 'bcast_frontpage_202603';
5const sso: string = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.exampleSignature';
6
7const result: PinComment200Response = await unPinComment(tenantId, commentId, broadcastId, sso);
8

updateComment Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
idstringДа
updatableCommentParamsUpdatableCommentParamsДа
contextUserIdstringНе
doSpamCheckbooleanНе
isLivebooleanНе

Одговор

Враћа: FlagCommentPublic200Response

Пример

updateComment Пример
Copy Copy
1
2const tenantId: string = "tenant_3f47b2a1";
3const id: string = "comment_9a12b3c4";
4const updatableCommentParams: UpdatableCommentParams = {
5 body: "Thanks for the update — I've adjusted my view accordingly."
6};
7const contextUserId: string = "user_8721";
8const doSpamCheck: boolean = true;
9const isLive: boolean = false;
10const result: FlagCommentPublic200Response = await updateComment(tenantId, id, updatableCommentParams, contextUserId, doSpamCheck, isLive);
11

voteComment Internal Link

Параметри

НазивТипОбавезноОпис
tenantIdstringДа
commentIdstringДа
urlIdstringДа
broadcastIdstringДа
voteBodyParamsVoteBodyParamsДа
sessionIdstringНе
ssostringНе

Одговор

Враћа: VoteComment200Response

Пример

Пример за voteComment
Copy Copy
1
2const tenantId: string = 'tenant_9f8b7c';
3const commentId: string = 'cmt_42f3a1';
4const urlId: string = 'articles/ai-trends-2026';
5const broadcastId: string = 'web';
6const voteBodyParams: VoteBodyParams = { vote: 1, reason: 'Insightful and on-topic' };
7const sessionId: string = 'sess_6d2b4c9e';
8const sso: string = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9';
9const result: VoteComment200Response = await voteComment(tenantId, commentId, urlId, broadcastId, voteBodyParams, sessionId, sso);
10

getCommentsForUser Internal Link

Параметри

ИмеТипОбавезноОпис
userIdstringНе
tenantIdstringНе
urlIdstringНе
pagenumberНе
directionSortDirectionsНе
lastGenDatenumberНе
repliesToUserIdstringНе
fetchPageForCommentIdstringНе
includei10nbooleanНе
useFullTranslationIdsbooleanНе
localestringНе
includeConfigbooleanНе
includeNotificationCountbooleanНе
countAllbooleanНе
ssostringНе

Одговор

Враћа: GetCommentsForUserResponse

Пример

getCommentsForUser пример
Copy Copy
1
2const userId: string = 'user_82f9b';
3const tenantId: string = 'tenant_22';
4const page: number = 2;
5const lastGenDate: number = Date.now();
6const includei10n: boolean = true;
7const useFullTranslationIds: boolean = false;
8const locale: string = 'en-US';
9const includeConfig: boolean = true;
10const includeNotificationCount: boolean = true;
11const countAll: boolean = false;
12const sso: string = 'sso-token-1a2b';
13const commentsResponse: GetCommentsForUserResponse = await getCommentsForUser(userId, tenantId, undefined, page, undefined, lastGenDate, undefined, undefined, includei10n, useFullTranslationIds, locale, includeConfig, includeNotificationCount, countAll, sso);
14

addDomainConfig Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
addDomainConfigParamsAddDomainConfigParamsДа

Одговор

Враћа: AddDomainConfig200Response


deleteDomainConfig Internal Link

Parametri

ImeTipObaveznoOpis
tenantIdstringДа
domainstringДа

Odgovor

Vraća: DeleteDomainConfig200Response


getDomainConfig Internal Link


Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
domainstringДа

Одговор

Враћа: GetDomainConfig200Response


getDomainConfigs Internal Link


Параметри

ИмеТипОбавезноОпис
tenantIdstringДа

Одговор

Враћа: GetDomainConfigs200Response


patchDomainConfig Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
domainToUpdatestringДа
patchDomainConfigParamsPatchDomainConfigParamsДа

Одговор

Враћа: GetDomainConfig200Response


putDomainConfig Internal Link


Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
domainToUpdatestringДа
updateDomainConfigParamsUpdateDomainConfigParamsДа

Одговор

Враћа: GetDomainConfig200Response


createEmailTemplate Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
createEmailTemplateBodyCreateEmailTemplateBodyДа

Одговор

Враћа: CreateEmailTemplate200Response

Пример

createEmailTemplate Пример
Copy Copy
1
2(async () => {
3 const tenantId: string = 'tenant_9f4a2b';
4 const createEmailTemplateBody: CreateEmailTemplateBody = {
5 name: 'Weekly Digest',
6 subject: 'Your weekly discussion highlights',
7 html: '<!doctype html><body><h1>Hello \{{user.name}}</h1><p>Top comments this week...</p></body>',
8 fromAddress: 'no-reply@fastcomments-example.com',
9 replyTo: 'moderation@fastcomments-example.com',
10 isDefault: false
11 };
12 const result: CreateEmailTemplate200Response = await createEmailTemplate(tenantId, createEmailTemplateBody);
13 console.log(result);
14})();
15

deleteEmailTemplate Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
idstringДа

Одговор

Враћа: FlagCommentPublic200Response

Пример

deleteEmailTemplate Пример
Copy Copy
1
2const tenantId: string = "acme-corp-42";
3const idSuffix: string | undefined = "-archived";
4const templateId: string = "email_tmpl_6a1b2c" + (idSuffix ?? "");
5const result: FlagCommentPublic200Response = await deleteEmailTemplate(tenantId, templateId);
6

deleteEmailTemplateRenderError Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
idstringДа
errorIdstringДа

Одговор

Враћа: FlagCommentPublic200Response

Пример

deleteEmailTemplateRenderError Пример
Copy Copy
1
2const tenantId: string = "tenant_7a1d2f9b";
3const id: string = "email_template_42b1";
4const errorId: string = "render_err_2026-04-24_7f3c";
5const includeStackTrace: boolean | undefined = undefined; // пример опционалног флага
6
7const response: FlagCommentPublic200Response = await deleteEmailTemplateRenderError(tenantId, id, errorId);
8// Ако би био подржан опционални објекат опција, могао би изгледати овако:
9// await deleteEmailTemplateRenderError(tenantId, id, errorId /*, { includeStackTrace } */);
10

getEmailTemplate Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
idstringДа

Одговор

Враћа: GetEmailTemplate200Response

Пример

getEmailTemplate Пример
Copy Copy
1
2const tenantId: string = "acme-marketing-042";
3const templateId: string = "tpl_welcome_2026";
4const result: GetEmailTemplate200Response = await getEmailTemplate(tenantId, templateId);
5const template: CustomEmailTemplate | undefined = result.template;
6const subject: string | undefined = template?.subject;
7const customParams: CustomConfigParameters | undefined = template?.customConfigParameters;
8

getEmailTemplateDefinitions Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа

Одговор

Враћа: GetEmailTemplateDefinitions200Response

Пример

getEmailTemplateDefinitions Пример
Copy Copy
1
2const tenantId: string = 'tenant_acme_eu_01';
3const templates: GetEmailTemplateDefinitions200Response = await getEmailTemplateDefinitions(tenantId);
4console.log('Email template definitions loaded for', tenantId, templates);
5

getEmailTemplateRenderErrors Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
idstringДа
skipnumberНе

Одговор

Враћа: GetEmailTemplateRenderErrors200Response

Пример

getEmailTemplateRenderErrors Пример
Copy Copy
1
2(async () => {
3 const tenantId: string = 'acme-tenant-42';
4 const id: string = 'tmpl_3fa85f64-5717-4562-b3fc-2c963f66afa6';
5 const skip: number = 20;
6 const result: GetEmailTemplateRenderErrors200Response = await getEmailTemplateRenderErrors(tenantId, id, skip);
7 console.log(result);
8})();
9

getEmailTemplates Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
skipnumberНе

Одговор

Враћа: GetEmailTemplates200Response

Пример

Пример getEmailTemplates
Copy Copy
1
2async function main(): Promise<void> {
3 const tenantId: string = 'tenant_5f3a9c2b';
4 const templates: GetEmailTemplates200Response = await getEmailTemplates(tenantId);
5 const skip: number = 20;
6 const pagedTemplates: GetEmailTemplates200Response = await getEmailTemplates(tenantId, skip);
7 console.log(templates, pagedTemplates);
8}
9main();
10

renderEmailTemplate Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
renderEmailTemplateBodyRenderEmailTemplateBodyДа
localestringНе

Одговор

Враћа: RenderEmailTemplate200Response

Пример

Пример renderEmailTemplate
Copy Copy
1
2const tenantId: string = 'acme-corp-987';
3const renderEmailTemplateBody: RenderEmailTemplateBody = {
4 templateId: 'user-invite',
5 subject: "You're invited to Acme",
6 placeholders: { firstName: 'Alex' },
7 metadata: { source: 'signup-flow' }
8};
9const locale: string = 'en-US';
10const result: RenderEmailTemplate200Response = await renderEmailTemplate(tenantId, renderEmailTemplateBody, locale);
11

updateEmailTemplate Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
idstringДа
updateEmailTemplateBodyUpdateEmailTemplateBodyДа

Одговор

Враћа: FlagCommentPublic200Response

Пример

updateEmailTemplate Пример
Copy Copy
1
2const tenantId: string = "tenant_76a4b2";
3const id: string = "template_9f3c1e";
4const updateEmailTemplateBody: UpdateEmailTemplateBody = {
5 name: "Comment Flag Notification",
6 subject: "A comment was flagged on your-site.com",
7 bodyHtml: "<p>Admin,</p><p>User \{{commenterName}} flagged a comment: “\{{commentText}}”</p>",
8 isEnabled: true,
9 description: "Email sent to moderators when a comment is flagged (optional field included)"
10};
11const result: FlagCommentPublic200Response = await updateEmailTemplate(tenantId, id, updateEmailTemplateBody);
12

getEventLog Internal Link

req tenantId urlId userIdWS

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
urlIdstringДа
userIdWSstringДа
startTimenumberДа
endTimenumberДа

Одговор

Враћа: GetEventLog200Response

Пример

Пример getEventLog
Copy Copy
1
2const tenantId: string = 'fastcomments-tenant-01';
3const urlId: string = 'article-2026-03-25';
4const userIdWS: string | undefined = undefined; // опционална улазна вредност
5const startTime: number = Date.parse('2026-03-01T00:00:00Z');
6const endTime: number = Date.parse('2026-03-25T23:59:59Z');
7
8const eventLogResponse: GetEventLog200Response = await getEventLog(
9 tenantId,
10 urlId,
11 userIdWS ?? 'ws_user_8b1f',
12 startTime,
13 endTime
14);
15

getGlobalEventLog Internal Link

req tenantId urlId userIdWS

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
urlIdstringДа
userIdWSstringДа
startTimenumberДа
endTimenumberДа

Одговор

Враћа: GetEventLog200Response

Пример

Пример getGlobalEventLog
Copy Copy
1
2const tenantId: string = "tenant-84b2f1";
3const urlId: string = "article-6721";
4const userIdWS: string = "ws-conn-9a3c";
5const startTime: number = Date.now() - 7 * 24 * 60 * 60 * 1000; // пре 7 дана
6const endTimeOptional: number | undefined = undefined; // опциони крај временског периода
7const endTime: number = endTimeOptional ?? Date.now();
8const eventLog: GetEventLog200Response = await getGlobalEventLog(tenantId, urlId, userIdWS, startTime, endTime);
9

createFeedPost Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
createFeedPostParamsCreateFeedPostParamsДа
broadcastIdstringНе
isLivebooleanНе
doSpamCheckbooleanНе
skipDupCheckbooleanНе

Одговор

Враћа: CreateFeedPost200Response

Пример

createFeedPost пример
Copy Copy
1
2const tenantId: string = 'tenant_87f3b2';
3const mediaAsset: FeedPostMediaItemAsset = { url: 'https://cdn.example.com/images/post-123.jpg', mimeType: 'image/jpeg', width: 1200, height: 800, size: 245000 };
4const mediaItem: FeedPostMediaItem = { id: 'media_1', type: 'image', assets: [mediaAsset], altText: 'Conference keynote stage' };
5const link: FeedPostLink = { url: 'https://news.example.com/keynote-recap', title: 'Keynote recap' };
6const createFeedPostParams: CreateFeedPostParams = {
7 title: 'Product Launch Highlights',
8 content: 'Highlights from today’s product launch and roadmap updates.',
9 authorId: 'user_42',
10 mediaItems: [mediaItem],
11 links: [link],
12 tags: ['product', 'launch', 'announcement']
13};
14const broadcastId: string = 'broadcast_20260424';
15const isLive: boolean = true;
16const doSpamCheck: boolean = true;
17const skipDupCheck: boolean = false;
18const result: CreateFeedPost200Response = await createFeedPost(tenantId, createFeedPostParams, broadcastId, isLive, doSpamCheck, skipDupCheck);
19

createFeedPostPublic Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
createFeedPostParamsCreateFeedPostParamsДа
broadcastIdstringНе
ssostringНе

Одговор

Враћа: CreateFeedPostPublic200Response

Пример

createFeedPostPublic пример
Copy Copy
1
2const tenantId: string = "tenant_987654321";
3const asset: FeedPostMediaItemAsset = { url: "https://cdn.fastcomments.com/uploads/team-photo.jpg", mimeType: "image/jpeg", sizeBytes: 324512 };
4const mediaItem: FeedPostMediaItem = { type: "image", assets: [asset], caption: "Team launch day" };
5const link: FeedPostLink = { url: "https://www.example.com/blog/product-update-march-2026", title: "Product update — March 2026" };
6const createFeedPostParams: CreateFeedPostParams = {
7 title: "Product update — March 2026",
8 content: "<p>We shipped performance improvements and two new integrations.</p>",
9 media: [mediaItem],
10 link,
11 visibility: "public",
12 tags: ["product","release","march-2026"],
13 customConfig: { allowComments: true, requireTOS: false }
14};
15const broadcastId: string = "broadcast_2026_03_25_live";
16const sso: string = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIxMjM0NSIsImlhdCI6MTY5MDI0MDB9.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c";
17const result: CreateFeedPostPublic200Response = await createFeedPostPublic(tenantId, createFeedPostParams, broadcastId, sso);
18

deleteFeedPostPublic Internal Link

Параметри

NameTypeRequiredDescription
tenantIdstringДа
postIdstringДа
broadcastIdstringНе
ssostringНе

Одговор

Враћа: DeleteFeedPostPublic200Response

Пример

deleteFeedPostPublic Пример
Copy Copy
1
2const tenantId: string = "tenant_5f8a9b3c";
3const postId: string = "post_a1b2c3d4";
4const broadcastId: string = "broadcast_2026-03-25T10:00:00Z";
5const sso: string = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ1c2VyMTIzIiwiaWF0IjoxNjE5MjM5MjAwfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c";
6
7const resultWithOptional: DeleteFeedPostPublic200Response = await deleteFeedPostPublic(tenantId, postId, broadcastId, sso);
8const resultRequiredOnly: DeleteFeedPostPublic200Response = await deleteFeedPostPublic(tenantId, postId);
9

getFeedPosts Internal Link

req tenantId afterId

Параметри

NameTypeRequiredDescription
tenantIdstringДа
afterIdstringНе
limitnumberНе
tagsArrayНе

Одговор

Враћа: GetFeedPosts200Response

Пример

Пример getFeedPosts
Copy Copy
1
2const initialPage: GetFeedPosts200Response = await getFeedPosts('tenant_9f1b3d', undefined, 20, ['sports', 'local']);
3const nextPage: GetFeedPosts200Response = await getFeedPosts('tenant_9f1b3d', 'post_abc123', 20, ['sports', 'local']);
4

getFeedPostsPublic Internal Link

req tenantId afterId

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
afterIdstringНе
limitnumberНе
tagsArrayНе
ssostringНе
isCrawlerbooleanНе
includeUserInfobooleanНе

Одговор

Враћа: GetFeedPostsPublic200Response

Пример

getFeedPostsPublic пример
Copy Copy
1
2const tenantId: string = 'tenant_acme_01';
3const afterId: string = 'fp_20260301_042';
4const limit: number = 25;
5const tags: Array<string> = ['technology', 'announcement'];
6const sso: string = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjoiamRvZSJ9.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c';
7const isCrawler: boolean = false;
8const includeUserInfo: boolean = true;
9const response: GetFeedPostsPublic200Response = await getFeedPostsPublic(tenantId, afterId, limit, tags, sso, isCrawler, includeUserInfo);
10

getFeedPostsStats Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringYes
postIdsArrayYes
ssostringNo

Одговор

Враћа: GetFeedPostsStats200Response

Пример

Пример getFeedPostsStats
Copy Copy
1
2const tenantId: string = 'tenant_9b2f1c4a';
3const postIds: Array<string> = [
4 '8f14e45f-ea82-4c7a-b6b2-1a2b3c4d5e6f',
5 'd0e1f2a3-b4c5-6d7e-8f90-1234567890ab'
6];
7const sso: string = 'sso_eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.signature';
8const statsWithoutSSO: GetFeedPostsStats200Response = await getFeedPostsStats(tenantId, postIds);
9const statsWithSSO: GetFeedPostsStats200Response = await getFeedPostsStats(tenantId, postIds, sso);
10

getUserReactsPublic Internal Link

Parametri

NazivTipObaveznoOpis
tenantIdstringDa
postIdsArrayNe
ssostringNe

Odgovor

Vraća: GetUserReactsPublic200Response

Primer

Primer getUserReactsPublic
Copy Copy
1
2const tenantId: string = "acme-tenant-8a4d2c";
3const postIds: string[] = ["post-645a2f", "post-645a30"];
4const sso: string = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ1c2VyXzEyMyIsImlhdCI6MTY2MTYwMDAwMH0.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c";
5const result: GetUserReactsPublic200Response = await getUserReactsPublic(tenantId, postIds, sso);
6

reactFeedPostPublic Internal Link


Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
postIdstringДа
reactBodyParamsReactBodyParamsДа
isUndobooleanНе
broadcastIdstringНе
urlIdstringНе
ssostringНе

Одговор

Враћа: ReactFeedPostPublic200Response

Пример

reactFeedPostPublic пример
Copy Copy
1
2const tenantId: string = "global-markets";
3const postId: string = "8e2c3f9a-4b6d-4f1a-9c2d-e8a1b2c3d4e5";
4const reactBodyParams: ReactBodyParams = { reactionType: "like", clientApp: "web-ui", timestamp: new Date().toISOString() };
5const isUndo: boolean = false;
6const broadcastId: string = "broadcast-2026-05-20";
7const urlId: string = "feed-post-8e2c";
8const sso: string = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.fake.payload";
9
10const result: ReactFeedPostPublic200Response = await reactFeedPostPublic(tenantId, postId, reactBodyParams, isUndo, broadcastId, urlId, sso);
11

updateFeedPost Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
idstringДа
feedPostFeedPostДа

Одговор

Враћа: FlagCommentPublic200Response

Пример

Пример updateFeedPost
Copy Copy
1
2const tenantId: string = 'acme-global-tenant-42';
3const id: string = 'f47ac10b-58cc-4372-a567-0e02b2c3d479';
4
5const asset: FeedPostMediaItemAsset = {
6 url: 'https://cdn.acme.com/images/product-launch.jpg',
7 mimeType: 'image/jpeg',
8 width: 1200,
9 height: 630
10};
11
12const mediaItem: FeedPostMediaItem = {
13 id: 'media-001',
14 type: 'image',
15 asset
16};
17
18const link: FeedPostLink = {
19 url: 'https://acme.com/blog/product-launch',
20 title: 'Product Launch Details'
21};
22
23const feedPost: FeedPost = {
24 title: 'Introducing the Q3 Product Suite',
25 body: 'We are excited to unveil our new lineup for Q3, focusing on performance and security improvements.',
26 media: [mediaItem], // опциони низ укључен
27 links: [link], // опционални линкови укључени
28 isPublished: true // опционална ознака за објављивање коришћена овде
29};
30
31const result: FlagCommentPublic200Response = await updateFeedPost(tenantId, id, feedPost);
32

updateFeedPostPublic Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
postIdstringДа
updateFeedPostParamsUpdateFeedPostParamsДа
broadcastIdstringНе
ssostringНе

Одговор

Враћа: CreateFeedPostPublic200Response

Пример

Пример updateFeedPostPublic
Copy Copy
1
2const tenantId: string = "tenant_9f4b2";
3const postId: string = "post_21a8e";
4const updateFeedPostParams: UpdateFeedPostParams = {
5 title: "Quarterly product update",
6 body: "Major performance improvements and bug fixes deployed today. See release notes and schedule.",
7 links: [{ url: "https://status.example.com/release-notes", title: "Release notes" }],
8 media: [
9 {
10 type: "image",
11 assets: [{ url: "https://cdn.example.com/updates/q2.png", mimeType: "image/png", width: 1200, height: 628 }]
12 }
13 ]
14};
15const broadcastId: string = "broadcast_live_202603";
16const sso: string = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.example.signature";
17const result: CreateFeedPostPublic200Response = await updateFeedPostPublic(tenantId, postId, updateFeedPostParams, broadcastId, sso);
18

flagCommentPublic Internal Link

Parametri

NazivTipObaveznoOpis
tenantIdstringDa
commentIdstringDa
isFlaggedbooleanDa
ssostringNe

Odgovor

Vraća: FlagCommentPublic200Response

Primer

flagCommentPublic Primer
Copy Copy
1
2const tenantId: string = "tenant_9f8b3c";
3const commentId: string = "comment_72a1d4";
4const isFlagged: boolean = true;
5const sso: string = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI1Njc4OSJ9.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c";
6const result: FlagCommentPublic200Response = await flagCommentPublic(tenantId, commentId, isFlagged, sso);
7

getGifLarge Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
largeInternalURLSanitizedstringДа

Одговор

Враћа: GifGetLargeResponse

Пример

Пример getGifLarge
Copy Copy
1
2const tenantId: string = 'tenant_8a92f4';
3const largeInternalURLSanitized: string = 'https://cdn.streamingco.com/gifs/product-demo-large.gif';
4let maybeStatus: APIStatus | undefined = undefined; // опционални метаподаци када су доступни
5const response: GifGetLargeResponse = await getGifLarge(tenantId, largeInternalURLSanitized);
6

getGifsSearch Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
searchstringДа
localestringНе
ratingstringНе
pagenumberНе

Одговор

Враћа: GifSearchResponse

Пример

getGifsSearch Пример
Copy Copy
1
2(async () => {
3 const tenantId: string = "global-media";
4 const search: string = "laughing baby";
5 const locale: string = "en-US";
6 const rating: string = "pg";
7 const page: number = 2;
8 const result: GifSearchResponse = await getGifsSearch(tenantId, search, locale, rating, page);
9 console.log(result);
10})();
11

getGifsTrending Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
localestringНе
ratingstringНе
pagenumberНе

Одговор

Враћа: GifSearchResponse

Пример

getGifsTrending пример
Copy Copy
1
2const tenantId: string = 'tenant_42';
3const locale: string = 'en-US';
4const rating: string = 'PG';
5const page: number = 1;
6const result: GifSearchResponse = await getGifsTrending(tenantId, locale, rating, page);
7

addHashTag Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringНе
createHashTagBodyCreateHashTagBodyНе

Одговор

Враћа: AddHashTag200Response

Пример

addHashTag Пример
Copy Copy
1
2const tenantId: string | undefined = undefined;
3const createHashTagBody: CreateHashTagBody = {
4 name: 'release-2026',
5 description: 'Feedback and bug reports for the April 2026 product release',
6 synonyms: ['v2-release', 'launch-2026'],
7 color: '#1d72b8',
8 isActive: true,
9 createdBy: 'product.manager@acme-corp.com'
10};
11const result: AddHashTag200Response = await addHashTag(tenantId, createHashTagBody);
12

addHashTagsBulk Internal Link

Параметри

НазивТипОбавезноОпис
tenantIdstringНе
bulkCreateHashTagsBodyBulkCreateHashTagsBodyНе

Одговор

Враћа: AddHashTagsBulk200Response

Пример

addHashTagsBulk Пример
Copy Copy
1
2const tenantId: string = 'tenant_acme_corp_01';
3const bulkCreateHashTagsBody: BulkCreateHashTagsBody = {
4 tags: [
5 { name: 'feature-request', slug: 'feature-request', description: 'Requests for new capabilities', isActive: true, customConfig: { visibility: 'public' } as unknown as CustomConfigParameters }
6 ]
7};
8const addHashTagsResponse: AddHashTagsBulk200Response = await addHashTagsBulk(tenantId, bulkCreateHashTagsBody);
9
10const bulkCreateHashTagsBodyNoTenant: BulkCreateHashTagsBody = {
11 tags: [
12 { name: 'ux-feedback', slug: 'ux-feedback', description: 'User experience suggestions', isActive: true }
13 ]
14};
15const addHashTagsResponseNoTenant: AddHashTagsBulk200Response = await addHashTagsBulk(undefined, bulkCreateHashTagsBodyNoTenant);
16

deleteHashTag Internal Link

Параметри

ИмеТипОбавезноОпис
tagstringДа
tenantIdstringНе
deleteHashTagRequestDeleteHashTagRequestНе

Одговор

Враћа: FlagCommentPublic200Response

Пример

deleteHashTag Пример
Copy Copy
1
2const tag: string = "spring-sale-2026";
3const tenantId: string = "tenant-9876";
4const deleteHashTagRequest: DeleteHashTagRequest = {
5 requestedBy: "admin@retailco.com",
6 reason: "Campaign ended; remove associated auto-tags",
7 cascadeDelete: true
8};
9const result: FlagCommentPublic200Response = await deleteHashTag(tag, tenantId, deleteHashTagRequest);
10

getHashTags Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
pagenumberНе

Одговор

Враћа: GetHashTags200Response

Пример

getHashTags Пример
Copy Copy
1
2const tenantId: string = 'acme-tenant-42';
3const pageNumber: number = 2;
4const responseWithPage: GetHashTags200Response = await getHashTags(tenantId, pageNumber);
5const responseWithoutPage: GetHashTags200Response = await getHashTags(tenantId);
6

patchHashTag Internal Link

Параметри

ИмеТипОбавезноОпис
tagstringДа
tenantIdstringНе
updateHashTagBodyUpdateHashTagBodyНе

Одговор

Враћа: PatchHashTag200Response

Пример

patchHashTag Пример
Copy Copy
1
2const tag: string = "feature-ux-refresh";
3const tenantId: string = "tenant_4f92c1";
4const updateHashTagBody: UpdateHashTagBody = {
5 label: "UX Refresh",
6 description: "Track comments related to the 2026 UX redesign",
7 isActive: true,
8 metadata: { owner: "product-design", rolloutPhase: "phase-2" }
9};
10const response: PatchHashTag200Response = await patchHashTag(tag, tenantId, updateHashTagBody);
11

createModerator Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
createModeratorBodyCreateModeratorBodyДа

Одговор

Враћа: CreateModerator200Response

Пример

createModerator Пример
Copy Copy
1
2const tenantId: string = "tenant_8f3b6c";
3const optionalConfig: CustomConfigParameters = { moderationThreshold: 5, escalateOnRepeatedOffenses: true };
4const newModerator: CreateModeratorBody = {
5 email: "lina.gomez@dailynews.com",
6 fullName: "Lina Gomez",
7 role: "senior_moderator",
8 enabled: true,
9 notifyByEmail: true,
10 customConfig: optionalConfig
11};
12const response: CreateModerator200Response = await createModerator(tenantId, newModerator);
13

deleteModerator Internal Link

Параметри

НазивТипОбавезноОпис
tenantIdstringДа
idstringДа
sendEmailstringНе

Одговор

Враћа: FlagCommentPublic200Response

Пример

Пример deleteModerator
Copy Copy
1
2const tenantId: string = 'tenant_9f8b7c6d';
3const id: string = 'mod_4a3e11ec9d1f0242ac120003';
4const sendEmail: string = 'true';
5const result: FlagCommentPublic200Response = await deleteModerator(tenantId, id, sendEmail);
6

getModerator Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
idstringДа

Одговор

Враћа: GetModerator200Response

Пример

getModerator Пример
Copy Copy
1
2const tenantId: string = 'acme-corp-tenant-123';
3const id: string = 'mod-987654321';
4const moderatorResponse: GetModerator200Response = await getModerator(tenantId, id);
5

getModerators Internal Link

Параметри

НазивТипОбавезноОпис
tenantIdstringДа
skipnumberНе

Одговор

Враћа: GetModerators200Response

Пример

Пример getModerators
Copy Copy
1
2const tenantId: string = 'tenant-12345-prod';
3const moderatorsPage1: GetModerators200Response = await getModerators(tenantId);
4const moderatorsPage2: GetModerators200Response = await getModerators(tenantId, 50);
5

sendInvite Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
idstringДа
fromNamestringДа

Одговор

Враћа: FlagCommentPublic200Response

Пример

sendInvite Пример
Copy Copy
1
2const tenantId: string = 'acme-corp-128';
3const id: string = 'comment-8421f';
4const fromName: string = 'Marcus Lindström';
5const note: string | undefined = undefined; // пример опционалног параметра
6const response: FlagCommentPublic200Response = await sendInvite(tenantId, id, fromName);
7

updateModerator Internal Link

Параметри

НазивТипОбавезноОпис
tenantIdstringДа
idstringДа
updateModeratorBodyUpdateModeratorBodyДа

Резултат

Враћа: FlagCommentPublic200Response

Пример

updateModerator Пример
Copy Copy
1
2const tenantId: string = "acme-enterprises-42";
3const id: string = "moderator_517";
4const updateModeratorBody: UpdateModeratorBody = {
5 displayName: "Sofia Martinez",
6 email: "sofia.martinez@acme.com",
7 permissions: ["approve_comments", "flag_spam", "suspend_users"],
8 active: true,
9 avatarUrl: "https://cdn.acme.com/avatars/sofia.jpg" // опционално поље (демонстрација)
10};
11const result: FlagCommentPublic200Response = await updateModerator(tenantId, id, updateModeratorBody);
12

deleteNotificationCount Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
idstringДа

Одговор

Враћа: FlagCommentPublic200Response

Пример

deleteNotificationCount Пример
Copy Copy
1
2const tenantId: string = "org-72a8f1b9";
3const id: string = "notif-8f9c2e4a";
4const result: FlagCommentPublic200Response = await deleteNotificationCount(tenantId, id);
5console.log(result);
6

getCachedNotificationCount Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
idstringДа

Одговор

Враћа: GetCachedNotificationCount200Response

Пример

getCachedNotificationCount пример
Copy Copy
1
2const tenantId: string = 'tenant_acme_42';
3const id: string = 'user_00012345';
4const includeUnreadOnly: boolean | undefined = true; // опциони флаг параметра (демонстрирано)
5const result: GetCachedNotificationCount200Response = await getCachedNotificationCount(tenantId, id);
6

getNotificationCount Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
userIdstringНе
urlIdstringНе
fromCommentIdstringНе
viewedbooleanНе
typestringНе

Одговор

Враћа: GetNotificationCount200Response

Пример

Пример getNotificationCount
Copy Copy
1
2const tenantId: string = 'tenant_abc123';
3const userId: string = 'user_987654321';
4const urlId: string = 'https://example.com/news/2026/new-features';
5const viewed: boolean = false;
6const type: string = 'reply';
7const notificationCountResponse: GetNotificationCount200Response = await getNotificationCount(tenantId, userId, urlId, undefined, viewed, type);
8

getNotifications Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
userIdstringНе
urlIdstringНе
fromCommentIdstringНе
viewedbooleanНе
typestringНе
skipnumberНе

Одговор

Враћа: GetNotifications200Response

Пример

Пример за getNotifications
Copy Copy
1
2const tenantId: string = "tenant_84b3f2";
3const userId: string = "user_1279";
4const urlId: string = "https://www.example.com/articles/2026/03/25/new-feature";
5const fromCommentId: string = "cmt_5421";
6const viewed: boolean = false;
7const type: string = "mention";
8const skip: number = 0;
9const notifications: GetNotifications200Response = await getNotifications(tenantId, userId, urlId, fromCommentId, viewed, type, skip);
10

updateNotification Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
idstringДа
updateNotificationBodyUpdateNotificationBodyДа
userIdstringНе

Одговор

Враћа: FlagCommentPublic200Response

Пример

Пример updateNotification
Copy Copy
1
2const tenantId: string = 'tenant_prod_8f4b2c';
3const id: string = 'notification_61a2e9';
4const userId: string = 'moderator_107';
5const updateNotificationBody: UpdateNotificationBody = {
6 name: 'Flagged Comment Notification',
7 enabled: true,
8 channels: ['email', 'inbox'],
9 templateId: 'tmpl_mod_alerts_01',
10 severity: 'high'
11};
12const result: FlagCommentPublic200Response = await updateNotification(tenantId, id, updateNotificationBody, userId);
13

addPage Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
createAPIPageDataCreateAPIPageDataДа

Одговор

Враћа: AddPageAPIResponse


deletePage Internal Link


Parametri

NazivTipObaveznoOpis
tenantIdstringDa
idstringDa

Odgovor

Vraća: DeletePageAPIResponse


getPageByURLId Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
urlIdstringДа

Одговор

Враћа: GetPageByURLIdAPIResponse

getPages Internal Link


Параметри

НазивТипОбавезноОпис
tenantIdstringДа

Одговор

Враћа: GetPagesAPIResponse


patchPage Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
idstringДа
updateAPIPageDataUpdateAPIPageDataДа

Одговор

Враћа: PatchPageAPIResponse


deletePendingWebhookEvent Internal Link

Параметри

НазивТипОбавезноОпис
tenantIdstringДа
idstringДа

Одговор

Враћа: FlagCommentPublic200Response

Пример

Пример deletePendingWebhookEvent
Copy Copy
1
2const tenantId: string = "tenant_7f3b2a";
3const webhookEventId: string = "wh_evt_9a8c7d1234";
4const dryRun: boolean | undefined = undefined; // опциони флаг (није обавезан за овај позив)
5const result: FlagCommentPublic200Response = await deletePendingWebhookEvent(tenantId, webhookEventId);
6

getPendingWebhookEventCount Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
commentIdstringНе
externalIdstringНе
eventTypestringНе
typestringНе
domainstringНе
attemptCountGTnumberНе

Одговор

Враћа: GetPendingWebhookEventCount200Response

Пример

getPendingWebhookEventCount Пример
Copy Copy
1
2const tenantId: string = "tenant_8d3b7a2f";
3const commentId: string | undefined = "comment_79a2b";
4const eventType: string | undefined = "comment.created";
5const domain: string | undefined = "forum.acme-corp.com";
6const attemptCountGT: number | undefined = 1;
7const result: GetPendingWebhookEventCount200Response = await getPendingWebhookEventCount(
8 tenantId,
9 commentId,
10 undefined,
11 eventType,
12 undefined,
13 domain,
14 attemptCountGT
15);
16

getPendingWebhookEvents Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
commentIdstringНе
externalIdstringНе
eventTypestringНе
typestringНе
domainstringНе
attemptCountGTnumberНе
skipnumberНе

Одговор

Враћа: GetPendingWebhookEvents200Response

Пример

Пример getPendingWebhookEvents
Copy Copy
1
2const tenantId: string = 'tenant_9b3f7c';
3const commentId: string | undefined = undefined;
4const externalId: string | undefined = 'external-572a';
5const eventType: string | undefined = 'comment.updated';
6const type: string | undefined = 'outbound';
7const domain: string | undefined = 'reviews.example.com';
8const attemptCountGT: number | undefined = 1;
9const skip: number | undefined = 20;
10
11const result: GetPendingWebhookEvents200Response = await getPendingWebhookEvents(
12 tenantId,
13 commentId,
14 externalId,
15 eventType,
16 type,
17 domain,
18 attemptCountGT,
19 skip
20);
21

createQuestionConfig Internal Link

Параметри

NameTypeRequiredDescription
tenantIdstringДа
createQuestionConfigBodyCreateQuestionConfigBodyДа

Одговор

Враћа: CreateQuestionConfig200Response

Пример

createQuestionConfig Пример
Copy Copy
1
2const tenantId: string = "tenant_acme_01";
3const createQuestionConfigBody: CreateQuestionConfigBody = {
4 title: "Post-purchase feedback",
5 description: "Quick survey about your recent order",
6 required: true,
7 renderingType: "single_choice",
8 options: [
9 { label: "Very dissatisfied", value: "1" },
10 { label: "Dissatisfied", value: "2" },
11 { label: "Neutral", value: "3" },
12 { label: "Satisfied", value: "4" },
13 { label: "Very satisfied", value: "5" }
14 ] as QuestionConfigCustomOptionsInner[]
15} as CreateQuestionConfigBody;
16const result: CreateQuestionConfig200Response = await createQuestionConfig(tenantId, createQuestionConfigBody);
17

deleteQuestionConfig Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
idstringДа

Одговор

Враћа: FlagCommentPublic200Response

Пример

deleteQuestionConfig пример
Copy Copy
1
2const tenantId: string = "tenant_42fa9b7c";
3const id: string = "qcfg-0f8fad5b-d9cb-469f-a165-70867728950e";
4const result: FlagCommentPublic200Response = await deleteQuestionConfig(tenantId, id);
5

getQuestionConfig Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
idstringДа

Одговор

Враћа: GetQuestionConfig200Response

Пример

getQuestionConfig Пример
Copy Copy
1
2const tenantId: string = 'acme-tenant-92';
3const id: string = 'question-2026-07-42';
4const response: GetQuestionConfig200Response = await getQuestionConfig(tenantId, id);
5
6function summarize(cfg: GetQuestionConfig200Response, includeDetails?: boolean): string {
7 return includeDetails ? 'Question config (detailed)' : 'Question config (summary)';
8}
9
10const summary: string = summarize(response);
11

getQuestionConfigs Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
skipnumberНе

Одговор

Враћа: GetQuestionConfigs200Response

Пример

getQuestionConfigs Пример
Copy Copy
1
2const tenantId: string = "tenant_acme_9876";
3const configsWithoutSkip: GetQuestionConfigs200Response = await getQuestionConfigs(tenantId);
4const configsWithSkip: GetQuestionConfigs200Response = await getQuestionConfigs(tenantId, 20);
5

updateQuestionConfig Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
idstringДа
updateQuestionConfigBodyUpdateQuestionConfigBodyДа

Одговор

Враћа: FlagCommentPublic200Response

Пример

Пример updateQuestionConfig
Copy Copy
1
2const tenantId: string = 'tenant_42e8b';
3const id: string = 'question_9f4a2';
4const updateQuestionConfigBody: UpdateQuestionConfigBody = {
5 questionText: 'How helpful was this article?',
6 description: 'Shown to users below the question (optional)',
7 required: true,
8 renderingType: 'Likert' as QuestionRenderingType,
9 customOptions: [
10 { label: 'Very helpful', value: '5' } as QuestionConfigCustomOptionsInner,
11 { label: 'Somewhat helpful', value: '3' } as QuestionConfigCustomOptionsInner,
12 { label: 'Not helpful', value: '1' } as QuestionConfigCustomOptionsInner
13 ],
14 whenSave: 'notify' as QuestionWhenSave
15};
16const result: FlagCommentPublic200Response = await updateQuestionConfig(tenantId, id, updateQuestionConfigBody);
17

createQuestionResult Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
createQuestionResultBodyCreateQuestionResultBodyДа

Одговор

Враћа: CreateQuestionResult200Response

Пример

Пример createQuestionResult
Copy Copy
1
2const tenantId: string = 'fastcomments-tenant-01';
3const createQuestionResultBody: CreateQuestionResultBody = {
4 questionId: 'q-34567',
5 respondentId: 'user-8923',
6 answers: [{ optionId: 'opt_A', text: 'Agree', count: 1 }],
7 score: 5,
8 meta: [{ key: 'platform', value: 'web' }],
9 notifyModerators: false // опциони параметар
10} as CreateQuestionResultBody;
11const result: CreateQuestionResult200Response = await createQuestionResult(tenantId, createQuestionResultBody);
12

deleteQuestionResult Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
idstringДа

Одговор

Враћа: FlagCommentPublic200Response

Пример

deleteQuestionResult пример
Copy Copy
1
2const tenantIdEnv: string | undefined = process.env.FASTCOMMENTS_TENANT_ID;
3const tenantId: string = tenantIdEnv ?? 'tenant_78b3f2';
4const id: string = 'qres-9f2a3b1c';
5const response: FlagCommentPublic200Response = await deleteQuestionResult(tenantId, id);
6

getQuestionResult Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
idstringДа

Одговор

Враћа: GetQuestionResult200Response

Пример

getQuestionResult Пример
Copy Copy
1
2const tenantId: string = 'acme-corp-42';
3const id: string = 'question-9f8b7c';
4const includeComments: boolean | undefined = true; // пример опционалног параметра
5const result: GetQuestionResult200Response = await getQuestionResult(tenantId, id);
6console.log(result);
7

getQuestionResults Internal Link


Параметри

НазивТипОбавезноОпис
tenantIdstringДа
urlIdstringНе
userIdstringНе
startDatestringНе
questionIdstringНе
questionIdsstringНе
skipnumberНе

Одговор

Враћа: GetQuestionResults200Response

Пример

getQuestionResults пример
Copy Copy
1
2(async () => {
3 const tenantId: string = "tenant_9b3f";
4 const urlId: string = "survey-2026-spring";
5 const userId: string = "user_00123";
6 const startDate: string = "2026-04-01T00:00:00Z";
7 const questionIds: string = "q_42,q_43";
8 const skip: number = 0;
9 const result: GetQuestionResults200Response = await getQuestionResults(tenantId, urlId, userId, startDate, undefined, questionIds, skip);
10 console.log(result);
11})();
12

updateQuestionResult Internal Link

Параметри

НазивТипОбавезноОпис
tenantIdstringДа
idstringДа
updateQuestionResultBodyUpdateQuestionResultBodyДа

Одговор

Враћа: FlagCommentPublic200Response

Пример

Пример updateQuestionResult
Copy Copy
1
2const tenantId: string = 'tenant_7f8b3c';
3const id: string = 'questionResult_4621';
4const updateQuestionResultBody: UpdateQuestionResultBody = {
5 questionId: 'q_1024',
6 result: 'flagged',
7 score: 0.92,
8 notes: 'Automated moderation flagged for review',
9 meta: [{ key: 'source', value: 'ai-moderator' }] as MetaItem[], // опционални метаподаци
10 status: { code: 'review_pending' } as APIStatus
11} as UpdateQuestionResultBody;
12const result: FlagCommentPublic200Response = await updateQuestionResult(tenantId, id, updateQuestionResultBody);
13

aggregateQuestionResults Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
questionIdstringНе
questionIdsArrayНе
urlIdstringНе
timeBucketAggregateTimeBucketНе
startDateDateНе
forceRecalculatebooleanНе

Одговор

Враћа: AggregateQuestionResults200Response

Пример

aggregateQuestionResults Пример
Copy Copy
1
2const tenantId: string = "tenant_acme_001";
3const questionIds: string[] = ["q-2026-sales", "q-2026-support"];
4const urlId: string = "url_7f2c";
5const timeBucket: AggregateTimeBucket = { unit: "week", size: 1 };
6const startDate: Date = new Date("2026-01-01T00:00:00Z");
7const forceRecalculate: boolean = true;
8
9const result: AggregateQuestionResults200Response = await aggregateQuestionResults(
10 tenantId,
11 undefined,
12 questionIds,
13 urlId,
14 timeBucket,
15 startDate,
16 forceRecalculate
17);
18

bulkAggregateQuestionResults Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
bulkAggregateQuestionResultsRequestBulkAggregateQuestionResultsRequestДа
forceRecalculatebooleanНе

Одговор

Враћа: BulkAggregateQuestionResults200Response

Пример

bulkAggregateQuestionResults Пример
Copy Copy
1
2const tenantId: string = "tenant_acme_42";
3const bulkAggregateQuestionResultsRequest: BulkAggregateQuestionResultsRequest = {
4 questions: [
5 { questionId: "q-001", threadId: "thread-1001", questionType: "rating" },
6 { questionId: "q-002", threadId: "thread-1002", questionType: "yes_no" }
7 ],
8 timeRange: { from: "2026-03-01T00:00:00Z", to: "2026-04-01T00:00:00Z" },
9 groupBy: ["questionId", "threadId"]
10};
11const forceRecalculate: boolean = true;
12const result: BulkAggregateQuestionResults200Response = await bulkAggregateQuestionResults(tenantId, bulkAggregateQuestionResultsRequest, forceRecalculate);
13

combineCommentsWithQuestionResults Internal Link

Параметри

НазивТипОбавезноОпис
tenantIdstringДа
questionIdstringНе
questionIdsArrayНе
urlIdstringНе
startDateDateНе
forceRecalculatebooleanНе
minValuenumberНе
maxValuenumberНе
limitnumberНе

Одговор

Враћа: CombineCommentsWithQuestionResults200Response

Пример

combineCommentsWithQuestionResults Пример
Copy Copy
1
2const tenantId: string = 'tenant-acme-001';
3const questionId: string | undefined = 'q-analytics-42';
4const questionIds: string[] | undefined = ['q-analytics-42', 'q-feedback-17'];
5const urlId: string | undefined = 'url-987654';
6const startDate: Date | undefined = new Date('2026-01-01T00:00:00Z');
7const forceRecalculate: boolean | undefined = true;
8const minValue: number | undefined = 1;
9const maxValue: number | undefined = 5;
10const limit: number | undefined = 250;
11const result: CombineCommentsWithQuestionResults200Response = await combineCommentsWithQuestionResults(
12 tenantId,
13 questionId,
14 questionIds,
15 urlId,
16 startDate,
17 forceRecalculate,
18 minValue,
19 maxValue,
20 limit
21);
22

addSSOUser Internal Link


Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
createAPISSOUserDataCreateAPISSOUserDataДа

Одговор

Враћа: AddSSOUserAPIResponse


deleteSSOUser Internal Link


Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
idstringДа
deleteCommentsbooleanНе
commentDeleteModestringНе

Одговор

Враћа: DeleteSSOUserAPIResponse


getSSOUserByEmail Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
emailstringДа

Одговор

Враћа: GetSSOUserByEmailAPIResponse


getSSOUserById Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
idstringДа

Одговор

Враћа: GetSSOUserByIdAPIResponse


getSSOUsers Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
skipnumberНе

Одговор

Враћа: GetSSOUsers200Response


patchSSOUser Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
idstringДа
updateAPISSOUserDataUpdateAPISSOUserDataДа
updateCommentsbooleanНе

Одговор

Враћа: PatchSSOUserAPIResponse


putSSOUser Internal Link

Параметри

НазивТипОбавезноОпис
tenantIdstringДа
idstringДа
updateAPISSOUserDataUpdateAPISSOUserDataДа
updateCommentsbooleanНе

Одговор

Враћа: PutSSOUserAPIResponse

Пример

putSSOUser Пример
Copy Copy
1
2const tenantId: string = 'acme-enterprises-42';
3const id: string = 'usr-73a1b2';
4const updateAPISSOUserData: UpdateAPISSOUserData = {
5 email: 'marcus.ingram@acme.com',
6 givenName: 'Marcus',
7 familyName: 'Ingram',
8 roles: ['editor', 'project_owner'],
9 enabled: true
10};
11const result: PutSSOUserAPIResponse = await putSSOUser(tenantId, id, updateAPISSOUserData, true);
12

createSubscription Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
createAPIUserSubscriptionDataCreateAPIUserSubscriptionDataДа

Одговор

Враћа: CreateSubscriptionAPIResponse

Пример

Пример createSubscription
Copy Copy
1
2const tenantId: string = "acme-corp-tenant-123";
3const createAPIUserSubscriptionData: CreateAPIUserSubscriptionData = {
4 userId: "user_98765",
5 planId: "pro_monthly",
6 paymentMethod: { type: "card", cardId: "card_abc123" },
7 autoRenew: true,
8 trialDays: 14, // опционални параметар (пример)
9 metadata: { campaign: "spring_launch" } // опционални параметар (пример)
10};
11const result: CreateSubscriptionAPIResponse = await createSubscription(tenantId, createAPIUserSubscriptionData);
12

deleteSubscription Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
idstringДа
userIdstringНе

Одговор

Враћа: DeleteSubscriptionAPIResponse


getSubscriptions Internal Link

Параметри

NameTypeRequiredDescription
tenantIdstringДа
userIdstringНе

Одговор

Враћа: GetSubscriptionsAPIResponse

Пример

Пример getSubscriptions
Copy Copy
1
2const tenantId: string = "contoso-9a1b2c";
3const userId: string = "u-482f6";
4const subscriptions: GetSubscriptionsAPIResponse = await getSubscriptions(tenantId);
5const userSubscriptions: GetSubscriptionsAPIResponse = await getSubscriptions(tenantId, userId);
6

updateSubscription Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
idstringДа
updateAPIUserSubscriptionDataUpdateAPIUserSubscriptionDataДа
userIdstringНе

Одговор

Враћа: UpdateSubscriptionAPIResponse

Пример

Пример updateSubscription
Copy Copy
1
2const tenantId: string = 'tenant_9f3b2c';
3const subscriptionId: string = 'sub_7641a2b3';
4const updateData: UpdateAPIUserSubscriptionData = {
5 status: 'active',
6 planId: 'pro_annual',
7 autoRenew: true,
8 renewalDate: '2026-04-15T00:00:00Z',
9 metadata: { upgradedBy: 'billing-team' }
10};
11const userId: string = 'user_215';
12const result: UpdateSubscriptionAPIResponse = await updateSubscription(tenantId, subscriptionId, updateData, userId);
13

getTenantDailyUsages Internal Link

Параметри

НазивТипОбавезноОпис
tenantIdstringДа
yearNumbernumberНе
monthNumbernumberНе
dayNumbernumberНе
skipnumberНе

Одговор

Враћа: GetTenantDailyUsages200Response

Пример

Пример getTenantDailyUsages
Copy Copy
1
2const tenantId: string = 'tenant_5f4a3b2c-1d6e-4f9a-b9d8-123456789abc';
3const yearNumber: number = 2026;
4const monthNumber: number = 3;
5const dayNumber: number = 24;
6const skip: number = 0;
7
8const result: GetTenantDailyUsages200Response = await getTenantDailyUsages(tenantId, yearNumber, monthNumber, dayNumber, skip);
9

createTenantPackage Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringYes
createTenantPackageBodyCreateTenantPackageBodyYes

Одговор

Враћа: CreateTenantPackage200Response

Пример

Пример createTenantPackage
Copy Copy
1
2const tenantId: string = "tenant_acme-corp_001";
3const createTenantPackageBody: CreateTenantPackageBody = {
4 name: "Acme Standard Package",
5 description: "Default package for Acme Corp comments with moderation and SSO enabled",
6 enabled: true,
7 maxCommentsPerThread: 500,
8 voteStyle: "thumbs",
9 gifRating: "PG-13",
10 tosConfig: { enabled: true, url: "https://acme.example.com/terms" } // пример опционог параметра
11};
12const result: CreateTenantPackage200Response = await createTenantPackage(tenantId, createTenantPackageBody);
13

deleteTenantPackage Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
idstringДа

Одговор

Враћа: FlagCommentPublic200Response

Пример

Пример deleteTenantPackage
Copy Copy
1
2(async () => {
3 const tenantId: string = "tenant_8f3a2b4c9d01";
4 const packageId: string = "pkg_2026-04-security-patch";
5 const result: FlagCommentPublic200Response = await deleteTenantPackage(tenantId, packageId);
6 console.log(result);
7})();
8

getTenantPackage Internal Link

Параметри

НазивТипОбавезноОпис
tenantIdstringДа
idstringДа

Одговор

Враћа: GetTenantPackage200Response

Пример

Пример getTenantPackage
Copy Copy
1
2const tenantId: string = 'tenant_7f3b2c8';
3const packageId: string = 'pkg_standard_2026';
4const requestOptions: { includeConfig?: boolean } = { includeConfig: true };
5const packageResponse: GetTenantPackage200Response = await getTenantPackage(tenantId, packageId);
6

getTenantPackages Internal Link


Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
skipnumberНе

Одговор

Враћа: GetTenantPackages200Response

Пример

Пример getTenantPackages
Copy Copy
1
2const tenantId: string = 'tenant-7b3c2f';
3const skipCount: number = 10;
4const packages: GetTenantPackages200Response = await getTenantPackages(tenantId, skipCount);
5const packagesFromStart: GetTenantPackages200Response = await getTenantPackages(tenantId);
6

replaceTenantPackage Internal Link


Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
idstringДа
replaceTenantPackageBodyReplaceTenantPackageBodyДа

Одговор

Враћа: FlagCommentPublic200Response

Пример

replaceTenantPackage Пример
Copy Copy
1
2const tenantId: string = "tenant-9f3c2a";
3const id: string = "pkg_4f8b21";
4const replaceTenantPackageBody: ReplaceTenantPackageBody = {
5 packageName: "Premium Moderation Pack",
6 enabled: true,
7 apiStatus: { mode: "active" } as APIStatus,
8 customConfigParameters: { maxFlagsBeforeReview: 5 } as CustomConfigParameters,
9 voteStyle: "thumbs" as VoteStyle,
10 tosConfig: { requireAcceptance: true } as TOSConfig
11};
12const result: FlagCommentPublic200Response = await replaceTenantPackage(tenantId, id, replaceTenantPackageBody);
13

updateTenantPackage Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
idstringДа
updateTenantPackageBodyUpdateTenantPackageBodyДа

Одговор

Враћа: FlagCommentPublic200Response

Пример

updateTenantPackage Пример
Copy Copy
1
2(async () => {
3 const tenantId: string = "tenant_sf_001";
4 const id: string = "pkg-premium-v2";
5 const updateTenantPackageBody: UpdateTenantPackageBody = {
6 name: "San Francisco Premium",
7 enabled: true,
8 customConfig: { maxComments: 500 },
9 tosConfig: { required: true } // опционална поља су приказана присуством; остала су изостављена
10 } as UpdateTenantPackageBody;
11 const result: FlagCommentPublic200Response = await updateTenantPackage(tenantId, id, updateTenantPackageBody);
12 console.log(result);
13})();
14

createTenantUser Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringYes
createTenantUserBodyCreateTenantUserBodyYes

Одговор

Враћа: CreateTenantUser200Response

Пример

Пример за createTenantUser
Copy Copy
1
2const tenantId: string = "tenant_74b3a9f4b";
3const createTenantUserBody: CreateTenantUserBody = {
4 email: "jane.doe@acmecorp.com",
5 displayName: "Jane Doe",
6 role: "moderator",
7 sendWelcomeEmail: true, // опциони параметар демонстриран
8 metadata: { department: "Customer Support" }
9};
10const result: CreateTenantUser200Response = await createTenantUser(tenantId, createTenantUserBody);
11

deleteTenantUser Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
idstringДа
deleteCommentsstringНе
commentDeleteModestringНе

Одговор

Враћа: FlagCommentPublic200Response

Пример

deleteTenantUser Пример
Copy Copy
1
2async function run(): Promise<void> {
3 const tenantId: string = "acme_corp_tenant_9f1a2b";
4 const id: string = "user_4d2a1b6c";
5 const deleteComments: string = "true"; // уклони и коментаре корисника
6 const commentDeleteMode: string = "permanent"; // "permanent" или "soft"
7 const result: FlagCommentPublic200Response = await deleteTenantUser(tenantId, id, deleteComments, commentDeleteMode);
8 console.log(result);
9}
10run();
11

getTenantUser Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
idstringДа

Одговор

Враћа: GetTenantUser200Response

Пример

getTenantUser Пример
Copy Copy
1
2const tenantId: string = 'tenant_fc5a9b2c';
3const userId: string = 'user_0a12b3';
4const result: GetTenantUser200Response = await getTenantUser(tenantId, userId);
5const user: User | undefined = (result as any).user; // accessing payload
6const userEmail: string | undefined = user?.email;
7console.log('Fetched user email:', userEmail);
8

getTenantUsers Internal Link

Параметри

ИмеTypeОбавезноОпис
tenantIdstringДа
skipnumberНе

Одговор

Враћа: GetTenantUsers200Response

Пример

getTenantUsers Пример
Copy Copy
1
2const tenantId: string = 'tenant_prod_8a3f2c';
3const skip: number = 50;
4const usersWithSkip: GetTenantUsers200Response = await getTenantUsers(tenantId, skip);
5const usersNoSkip: GetTenantUsers200Response = await getTenantUsers(tenantId);
6

replaceTenantUser Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
idstringДа
replaceTenantUserBodyReplaceTenantUserBodyДа
updateCommentsstringНе

Одговор

Враћа: FlagCommentPublic200Response

Пример

Пример replaceTenantUser
Copy Copy
1
2const tenantId: string = "tenant_acmeCorp";
3const id: string = "user_84b2";
4const replaceTenantUserBody: ReplaceTenantUserBody = {
5 email: "alice.jenkins@acmecorp.com",
6 displayName: "Alice Jenkins",
7 roles: ["moderator", "editor"],
8 disabled: false
9} as ReplaceTenantUserBody;
10const updateComments: string = "Migrated user account and reattributed historical comments";
11
12const result: FlagCommentPublic200Response = await replaceTenantUser(tenantId, id, replaceTenantUserBody, updateComments);
13


Параметри

НазивТипОбавезноОпис
tenantIdstringДа
idstringДа
redirectURLstringНе

Одговор

Враћа: FlagCommentPublic200Response

Пример

sendLoginLink Пример
Copy Copy
1
2const tenantId: string = "tenant_12a9f3b7";
3const id: string = "user_84b2c7d1";
4const redirectURL: string = "https://app.mycompany.com/welcome?ref=login_email";
5const resultWithoutRedirect: FlagCommentPublic200Response = await sendLoginLink(tenantId, id);
6const resultWithRedirect: FlagCommentPublic200Response = await sendLoginLink(tenantId, id, redirectURL);
7

updateTenantUser Internal Link

Параметри

NameTypeRequiredDescription
tenantIdstringДа
idstringДа
updateTenantUserBodyUpdateTenantUserBodyДа
updateCommentsstringНе

Одговор

Враћа: FlagCommentPublic200Response

Пример

Пример за updateTenantUser
Copy Copy
1
2const tenantId: string = "tenant_8f3b2a9d";
3const id: string = "user_52c9f1ab";
4const updateTenantUserBody: UpdateTenantUserBody = {
5 email: "jane.doe@example.com",
6 displayName: "Jane Doe",
7 roles: ["moderator"],
8 isActive: true,
9 metadata: { signupSource: "sso", locale: "en-US" }
10};
11const updateComments: string = "Promoted to moderator and updated display name";
12const result: FlagCommentPublic200Response = await updateTenantUser(tenantId, id, updateTenantUserBody, updateComments);
13

createTenant Internal Link

Параметри

НазивТипОбавезноОпис
tenantIdstringДа
createTenantBodyCreateTenantBodyДа

Одговор

Враћа: CreateTenant200Response

Пример

createTenant пример
Copy Copy
1
2const tenantId: string = 'acme-corp-001';
3const createTenantBody: CreateTenantBody = {
4 name: 'Acme Corporation',
5 domainConfiguration: { primaryDomain: 'comments.acme.com', enforceHttps: true } as APIDomainConfiguration,
6 billingInfo: { planId: 'enterprise', contactEmail: 'billing@acme.com' } as BillingInfo
7 // опционална поља попут ssoConfig или customConfig намерно су изостављена
8} as CreateTenantBody;
9
10const result: CreateTenant200Response = await createTenant(tenantId, createTenantBody);
11

deleteTenant Internal Link

Параметри

НазивТипЗахтеваноОпис
tenantIdstringДа
idstringДа
surestringНе

Одговор

Враћа: FlagCommentPublic200Response

Пример

Пример deleteTenant
Copy Copy
1
2const tenantId: string = 'tenant_42c9f1';
3const id: string = 'flag_9a7b3c';
4const sure: string = 'confirm-delete';
5const result: FlagCommentPublic200Response = await deleteTenant(tenantId, id, sure);
6

getTenant Internal Link

Параметри

NameTypeRequiredDescription
tenantIdstringДа
idstringДа

Одговор

Враћа: GetTenant200Response

Пример

getTenant Пример
Copy Copy
1
2const tenantId: string = "tenant_9f4b2c1a";
3const idOverride: string | undefined = undefined; // опциони оверрајд, ако је доступан
4const id: string = idOverride ?? "site_3e7a6b2f";
5const response: GetTenant200Response = await getTenant(tenantId, id);
6console.log(response);
7

getTenants Internal Link

Параметри

НазивТипОбавезноОпис
tenantIdstringДа
metastringНе
skipnumberНе

Одговор

Враћа: GetTenants200Response

Пример

getTenants Пример
Copy Copy
1
2const tenantId: string = 'tenant_8421e7';
3const meta: string = 'include=domains,billing,customConfig';
4const skip: number = 20;
5
6const tenantsBasic: GetTenants200Response = await getTenants(tenantId);
7const tenantsWithOptions: GetTenants200Response = await getTenants(tenantId, meta, skip);
8

updateTenant Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
idstringДа
updateTenantBodyUpdateTenantBodyДа

Одговор

Враћа: FlagCommentPublic200Response

Пример

Пример updateTenant
Copy Copy
1
2const tenantId: string = 'acme-corp-001';
3const id: string = 'tenant-42';
4const billingInfo: BillingInfo = { billingEmail: 'billing@acme.com', address: '123 Market St' } as BillingInfo;
5const updateTenantBody: UpdateTenantBody = { displayName: 'Acme Corporation', billingInfo } as UpdateTenantBody;
6const result: FlagCommentPublic200Response = await updateTenant(tenantId, id, updateTenantBody);
7

changeTicketState Internal Link

Параметри

NameTypeRequiredDescription
tenantIdstringДа
userIdstringДа
idstringДа
changeTicketStateBodyChangeTicketStateBodyДа

Одговор

Враћа: ChangeTicketState200Response

Пример

Пример changeTicketState
Copy Copy
1
2const tenantId: string = "tenant_7f3b2c9a";
3const userId: string = "user_5a1d9fb2";
4const id: string = "ticket_3e8a1b6f";
5const changeTicketStateBody: ChangeTicketStateBody = {
6 state: "closed",
7 reason: "Fixed in backend release 2.4.1",
8 notifyUsers: true,
9 metadata: { resolutionOwner: "agent_12", priority: "high" } // демонстрација опционих поља
10};
11const result: ChangeTicketState200Response = await changeTicketState(tenantId, userId, id, changeTicketStateBody);
12

createTicket Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
userIdstringДа
createTicketBodyCreateTicketBodyДа

Одговор

Враћа: CreateTicket200Response

Пример

createTicket Пример
Copy Copy
1
2const tenantId: string = 'acme-company-001';
3const userId: string = 'u_78f4b2';
4const createTicketBody: CreateTicketBody = {
5 title: 'Unable to access project dashboard',
6 description: 'Receiving 403 when accessing /dashboard for project X',
7 priority: 'high',
8 tags: ['dashboard', 'access'] // опционално поље (приказано)
9};
10const result: CreateTicket200Response = await createTicket(tenantId, userId, createTicketBody);
11

getTicket Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
idstringДа
userIdstringНе

Одговор

Враћа: GetTicket200Response

Пример

getTicket Пример
Copy Copy
1
2const tenantId: string = 'acme-corp-tenant-01';
3const ticketId: string = 'tkt-20260325-42';
4const userId: string = 'user-8452';
5
6const ticketResponseWithUser: GetTicket200Response = await getTicket(tenantId, ticketId, userId);
7const ticketResponseWithoutUser: GetTicket200Response = await getTicket(tenantId, ticketId);
8

getTickets Internal Link

Параметри

НазивТипОбавезноОпис
tenantIdstringДа
userIdstringНе
statenumberНе
skipnumberНе
limitnumberНе

Одговор

Враћа: GetTickets200Response

Пример

getTickets Пример
Copy Copy
1
2const tenantId: string = "tenant_92f3b4c1";
3const userId: string = "user_742a9f3e";
4const state: number = 1;
5const skip: number = 0;
6const limit: number = 25;
7const ticketsFull: GetTickets200Response = await getTickets(tenantId, userId, state, skip, limit);
8const ticketsMinimal: GetTickets200Response = await getTickets("tenant_92f3b4c1");
9

getTranslations Internal Link

Параметри

ИмеТипОбавезноОпис
namespacestringДа
componentstringДа
localestringНе
useFullTranslationIdsbooleanНе

Одговор

Враћа: GetTranslationsResponse

Пример

getTranslations пример
Copy Copy
1
2const translationsDefault: GetTranslationsResponse = await getTranslations("payments", "checkout");
3const translationsFrenchDetailed: GetTranslationsResponse = await getTranslations("payments", "checkout", "fr-FR", true);
4

uploadImage Internal Link


Отпремите и промените величину слике

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
fileBlobДа
sizePresetSizePresetНе
urlIdstringНе

Одговор

Враћа: UploadImageResponse


getUserBadgeProgressById Internal Link


Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
idstringДа

Одговор

Враћа: GetUserBadgeProgressById200Response

Пример

getUserBadgeProgressById Пример
Copy Copy
1
2const optionalTenantSuffix: string | undefined = undefined;
3const tenantId: string = `5f8d0d55-1234-4ab1-9e2a-3f2b5c6d7e8f${optionalTenantSuffix ?? ''}`;
4const id: string = '3a2b1c4d-5678-4ef0-9abc-def123456789';
5const result: GetUserBadgeProgressById200Response = await getUserBadgeProgressById(tenantId, id);
6

getUserBadgeProgressByUserId Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
userIdstringДа

Одговор

Враћа: GetUserBadgeProgressById200Response

Пример

Пример getUserBadgeProgressByUserId
Copy Copy
1
2const tenantId: string = 'tenant_7f9c2d3b';
3const maybeUserId: string | undefined = 'user_4b8e1f9a'; // опционални извор (може бити undefined)
4const userId: string = maybeUserId ?? 'user_fallback0001';
5const result: GetUserBadgeProgressById200Response = await getUserBadgeProgressByUserId(tenantId, userId);
6console.log(result);
7

getUserBadgeProgressList Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
userIdstringНе
limitnumberНе
skipnumberНе

Одговор

Враћа: GetUserBadgeProgressList200Response

Пример

Пример за getUserBadgeProgressList
Copy Copy
1
2(async () => {
3 const tenantId: string = 'tenant_4f8c2b9d';
4 const userId: string = 'user_9a7e215c';
5 const limit: number = 25;
6 const skip: number = 0;
7 const resultMinimal: GetUserBadgeProgressList200Response = await getUserBadgeProgressList(tenantId);
8 const resultFull: GetUserBadgeProgressList200Response = await getUserBadgeProgressList(tenantId, userId, limit, skip);
9 console.log(resultMinimal, resultFull);
10})();
11

createUserBadge Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
createUserBadgeParamsCreateUserBadgeParamsДа

Респонс

Враћа: CreateUserBadge200Response

Пример

Пример createUserBadge
Copy Copy
1
2const tenantId: string = "tenant_9a8b7c";
3const params: CreateUserBadgeParams = {
4 name: "Top Contributor",
5 slug: "top-contributor",
6 description: "Awarded for 100 approved comments",
7 iconUrl: "https://cdn.fastcomments.com/badges/top-contributor.png",
8 active: true,
9 criteria: { approvedComments: 100 },
10 customConfig: { showOnProfile: true } // опционалан параметар
11};
12const result: CreateUserBadge200Response = await createUserBadge(tenantId, params);
13

deleteUserBadge Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
idstringДа

Одговор

Враћа: UpdateUserBadge200Response

Пример

Пример deleteUserBadge
Copy Copy
1
2type DeleteOptions = { notifyModerators?: boolean };
3
4const tenantId: string = 'tenant_8a3f21';
5const id: string = 'badge_71f2b';
6const options: DeleteOptions = { notifyModerators: true };
7
8const result: UpdateUserBadge200Response = await deleteUserBadge(tenantId, id);
9

getUserBadge Internal Link

Параметри

НазивТипОбавезноОпис
tenantIdstringДа
idstringДа

Одговор

Враћа: GetUserBadge200Response

Пример

getUserBadge Пример
Copy Copy
1
2const tenantId: string = "tenant_acme_01";
3const id: string = "badge_8c7d2f";
4const response: GetUserBadge200Response = await getUserBadge(tenantId, id);
5

getUserBadges Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringYes
userIdstringNo
badgeIdstringNo
typenumberNo
displayedOnCommentsbooleanNo
limitnumberNo
skipnumberNo

Одговор

Враћа: GetUserBadges200Response

Пример

getUserBadges Пример
Copy Copy
1
2const tenantId: string = 'tenant_acme_01';
3const userId: string = 'user_5f4d3c2a';
4const badgeId: string = 'badge_top_contributor';
5const type: number = 1;
6const displayedOnComments: boolean = true;
7const limit: number = 50;
8const skip: number = 0;
9
10const result: GetUserBadges200Response = await getUserBadges(tenantId, userId, badgeId, type, displayedOnComments, limit, skip);
11

updateUserBadge Internal Link

Параметри

НазивТипОбавезноОпис
tenantIdstringДа
idstringДа
updateUserBadgeParamsUpdateUserBadgeParamsДа

Одговор

Враћа: UpdateUserBadge200Response

Пример

Пример updateUserBadge
Copy Copy
1
2(async () => {
3 const tenantId: string = 'tenant_acme_987';
4 const id: string = 'badge_top_contributor_42';
5 const updateUserBadgeParams: UpdateUserBadgeParams = {
6 title: 'Top Contributor',
7 description: 'Awarded for reaching 100 high-quality comments',
8 color: '#FFD700',
9 iconUrl: 'https://cdn.acme.com/badges/top-contributor.svg',
10 active: true,
11 notifyUsers: true
12 } as UpdateUserBadgeParams;
13 const result: UpdateUserBadge200Response = await updateUserBadge(tenantId, id, updateUserBadgeParams);
14 console.log(result);
15})();
16

getUserNotificationCount Internal Link

Parametri

ImeTipObaveznoOpis
tenantIdstringDa
ssostringNe

Odgovor

Vraća: GetUserNotificationCount200Response

Primer

getUserNotificationCount Primer
Copy Copy
1
2(async () => {
3 const tenantId: string = '9f1e2d3c-4b5a-6d7e-8f90-123456789abc';
4 const ssoToken: string = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI0MjMifQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c';
5 const resultWithSSO: GetUserNotificationCount200Response = await getUserNotificationCount(tenantId, ssoToken);
6 const resultWithoutSSO: GetUserNotificationCount200Response = await getUserNotificationCount(tenantId);
7 console.log(resultWithSSO, resultWithoutSSO);
8})();
9

getUserNotifications Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
pageSizenumberНе
afterIdstringНе
includeContextbooleanНе
afterCreatedAtnumberНе
unreadOnlybooleanНе
dmOnlybooleanНе
noDmbooleanНе
includeTranslationsbooleanНе
ssostringНе

Одговор

Враћа: GetUserNotifications200Response

Пример

Пример getUserNotifications
Copy Copy
1
2const tenantId: string = 'tenant_7f3b1c';
3const pageSize: number = 25;
4const afterId: string = 'notif_b2f9e4';
5const includeContext: boolean = true;
6const afterCreatedAt: number = Date.now() - 24 * 60 * 60 * 1000;
7const unreadOnly: boolean = true;
8const dmOnly: boolean = false;
9const noDm: boolean = false;
10const includeTranslations: boolean = true;
11const sso: string = 'sso_tok_user_9f8d7c';
12const response: GetUserNotifications200Response = await getUserNotifications(
13 tenantId,
14 pageSize,
15 afterId,
16 includeContext,
17 afterCreatedAt,
18 unreadOnly,
19 dmOnly,
20 noDm,
21 includeTranslations,
22 sso
23);
24

resetUserNotificationCount Internal Link

Параметри

NameTypeRequiredDescription
tenantIdstringДа
ssostringНе

Одговор

Враћа: ResetUserNotifications200Response

Пример

Пример resetUserNotificationCount
Copy Copy
1
2(async () => {
3 const tenantId: string = "tenant_9f3b2c4a";
4 const ssoToken: string | undefined = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9._sample_payload_.signature";
5 const responseWithSSO: ResetUserNotifications200Response = await resetUserNotificationCount(tenantId, ssoToken);
6 const responseWithoutSSO: ResetUserNotifications200Response = await resetUserNotificationCount(tenantId);
7 console.log(responseWithSSO, responseWithoutSSO);
8})();
9

resetUserNotifications Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
afterIdstringНе
afterCreatedAtnumberНе
unreadOnlybooleanНе
dmOnlybooleanНе
noDmbooleanНе
ssostringНе

Одговор

Враћа: ResetUserNotifications200Response

Пример

resetUserNotifications Пример
Copy Copy
1
2const tenantId: string = "tenant_prod_4a9f12";
3const afterId: string = "notification_87213";
4const afterCreatedAt: number = Math.floor(Date.now() / 1000) - 3600;
5const unreadOnly: boolean = true;
6const dmOnly: boolean = false;
7const sso: string = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.example.payload";
8const result: ResetUserNotifications200Response = await resetUserNotifications(tenantId, afterId, afterCreatedAt, unreadOnly, dmOnly, undefined, sso);
9

updateUserNotificationCommentSubscriptionStatus Internal Link

Omogućite ili onemogućite obaveštenja za određeni komentar.

Parametri

ImeTipObaveznoOpis
tenantIdstringYes
notificationIdstringYes
optedInOrOutUpdateUserNotificationCommentSubscriptionStatusOptedInOrOutEnumYes
commentIdstringYes
ssostringNo

Odgovor

Vraća: UpdateUserNotificationStatus200Response

Primer

Primer updateUserNotificationCommentSubscriptionStatus
Copy Copy
1
2const tenantId: string = 'acme-tenant-001';
3const notificationId: string = 'notif-2026-03-25-01';
4const commentId: string = 'cmt-8f3a2b';
5const optedInOrOut: UpdateUserNotificationCommentSubscriptionStatusOptedInOrOutEnum = UpdateUserNotificationCommentSubscriptionStatusOptedInOrOutEnum.OptIn;
6const sso: string = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.sso-payload.signature';
7const result: UpdateUserNotificationStatus200Response = await updateUserNotificationCommentSubscriptionStatus(tenantId, notificationId, optedInOrOut, commentId, sso);
8

updateUserNotificationPageSubscriptionStatus Internal Link

Омогућите или онемогућите обавештења за страницу. Када су корисници претплаћени на страницу, обавештења се креирају за нове коренске коментаре, и такође

Параметри

NameTypeОбавезноОпис
tenantIdstringДа
urlIdstringДа
urlstringДа
pageTitlestringДа
subscribedOrUnsubscribedUpdateUserNotificationPageSubscriptionStatusSubscribedOrUnsubscribedEnumДа
ssostringНе

Одговор

Враћа: UpdateUserNotificationStatus200Response

Пример

Пример updateUserNotificationPageSubscriptionStatus
Copy Copy
1
2const tenantId: string = 'acme-tenant-42';
3const urlId: string = 'blog-launch-2026';
4const url: string = 'https://acme.example.com/blog/launch-march-2026';
5const pageTitle: string = 'Acme Product Launch — March 2026';
6const subscribedOrUnsubscribed: UpdateUserNotificationPageSubscriptionStatusSubscribedOrUnsubscribedEnum = UpdateUserNotificationPageSubscriptionStatusSubscribedOrUnsubscribedEnum.Subscribed;
7const sso: string = 'sso_jwt_eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9';
8const response: UpdateUserNotificationStatus200Response = await updateUserNotificationPageSubscriptionStatus(tenantId, urlId, url, pageTitle, subscribedOrUnsubscribed, sso);
9

updateUserNotificationStatus Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
notificationIdstringДа
newStatusUpdateUserNotificationStatusNewStatusEnumДа
ssostringНе

Одговор

Враћа: UpdateUserNotificationStatus200Response

Пример

updateUserNotificationStatus Пример
Copy Copy
1
2const tenantId: string = 'tenant_84a2c3';
3const notificationId: string = 'notif_20260325_01';
4const newStatus: UpdateUserNotificationStatusNewStatusEnum = UpdateUserNotificationStatusNewStatusEnum.Read;
5const sso: string = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.sso_signature_example';
6const result: UpdateUserNotificationStatus200Response = await updateUserNotificationStatus(tenantId, notificationId, newStatus, sso);
7

getUserPresenceStatuses Internal Link

Параметри

NameTypeRequiredDescription
tenantIdstringДа
urlIdWSstringДа
userIdsstringДа

Одговор

Враћа: GetUserPresenceStatuses200Response

Пример

Пример getUserPresenceStatuses
Copy Copy
1
2const tenantId: string = 'tenant_7f3a2b';
3const urlIdWS: string = 'articles/2026/03/25/fastcomments-integration';
4const maybeUserIds: string | undefined = 'user_123,user_456'; // опциони извор
5const userIds: string = maybeUserIds ?? 'user_123';
6const presence: GetUserPresenceStatuses200Response = await getUserPresenceStatuses(tenantId, urlIdWS, userIds);
7

searchUsers Internal Link

Параметри

НазивТипОбавезноОпис
tenantIdstringДа
urlIdstringДа
usernameStartsWithstringНе
mentionGroupIdsArrayНе
ssostringНе
searchSectionSearchUsersSearchSectionEnumНе

Одговор

Враћа: SearchUsers200Response

Пример

searchUsers пример
Copy Copy
1
2const tenantId: string = 'tenant_8392';
3const urlId: string = 'articles/2026/03/25/fastcomments-release';
4const usernameStartsWith: string = 'jo';
5const mentionGroupIds: Array<string> = ['editors', 'senior-writers'];
6const sso: string = 'sso_jwt_eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9';
7const searchSection: SearchUsersSearchSectionEnum = SearchUsersSearchSectionEnum.ALL;
8const result: SearchUsers200Response = await searchUsers(tenantId, urlId, usernameStartsWith, mentionGroupIds, sso, searchSection);
9

getUser Internal Link

Параметри

ИмеТипОбавезноОпис
tenantIdstringДа
idstringДа

Одговор

Враћа: GetUser200Response

Пример

getUser Пример
Copy Copy
1
2const idSuffix: string | undefined = undefined;
3const tenantId: string = "acme-enterprises";
4const id: string = idSuffix ?? "user_98765";
5const response: GetUser200Response = await getUser({ tenantId, id });
6

createVote Internal Link

Параметри

НазивТипОбавезноОпис
tenantIdstringДа
commentIdstringДа
directionCreateVoteDirectionEnumДа
userIdstringНе
anonUserIdstringНе

Одговор

Враћа: VoteComment200Response

Пример

Пример createVote
Copy Copy
1
2const tenantId: string = 'tenant_5f2a9b';
3const commentId: string = 'cmt_3b7e21';
4const direction: CreateVoteDirectionEnum = CreateVoteDirectionEnum.Up;
5const anonUserId: string = 'anon_9x7k2p';
6const voteResult: VoteComment200Response = await createVote(tenantId, commentId, direction, undefined, anonUserId);
7

deleteVote Internal Link

Параметри

НазивТипОбавезноОпис
tenantIdstringДа
idstringДа
editKeystringНе

Одговор

Враћа: DeleteCommentVote200Response

Пример

Пример за deleteVote
Copy Copy
1
2const tenantId: string = '123e4567-e89b-12d3-a456-426614174000';
3const id: string = 'vote-7a1b2c3d-9f8e-4b6a-8123-abcdef012345';
4const editKey: string = 'editKey_4f3e2d1c';
5
6const resultWithEditKey: DeleteCommentVote200Response = await deleteVote(tenantId, id, editKey);
7const resultWithoutEditKey: DeleteCommentVote200Response = await deleteVote(tenantId, id);
8

getVotes Internal Link

Параметри

NameTypeОбавезноОпис
tenantIdstringДа
urlIdstringДа

Одговор

Враћа: GetVotes200Response

Пример

getVotes пример
Copy Copy
1
2const tenantId: string = 'tenant-42c-eu';
3const urlId: string = 'article-7f9b';
4const includeMetadata: boolean | undefined = true;
5const votes: GetVotes200Response = await getVotes(tenantId, urlId);
6

getVotesForUser Internal Link

Параметри

НазивТипОбавезноОпис
tenantIdstringДа
urlIdstringДа
userIdstringНе
anonUserIdstringНе

Одговор

Враћа: GetVotesForUser200Response

Пример

getVotesForUser Пример
Copy Copy
1
2(async (): Promise<void> => {
3 const tenantId: string = "local-news-ny";
4 const urlId: string = "articles/2026-03-25/ev-infrastructure-update";
5 const userId: string = "user_78b6f3d9";
6 const anonUserId: string = "anon_9c3f7a1b";
7 const result: GetVotesForUser200Response = await getVotesForUser(tenantId, urlId, userId, anonUserId);
8 console.log(result);
9})();
10

Trebate pomoć?

Ako naiđete na bilo kakve probleme ili imate pitanja u vezi JavaScript/TypeScript SDK-a, molimo:

Doprinosi

Doprinosi su dobrodošli! Posetite GitHub repozitorijum za smernice o doprinosu.