FastComments.com

FastComments API

FastComments, birçok kaynakla etkileşim kurmak için bir API sağlar. Platformumuzla entegrasyonlar oluşturun veya kendi istemcilerinizi dahi yazın!

Bu dokümantasyonda, API tarafından desteklenen tüm kaynakları ve bunların istek ve yanıt tiplerini bulacaksınız.

Kurumsal (Enterprise) müşteriler için, tüm API erişimleri Denetim Günlüğü'ne (Audit Log) kaydedilir.

Oluşturulan SDK'lar

FastComments artık kodumuzdan bir API Spec üretiyor (bu henüz tamamlanmadı, ancak birçok API'yi içeriyor).

Ayrıca popüler diller için SDK'larımız da mevcut:

Kimlik Doğrulama

API, api key değerini ya X-API-KEY başlığı olarak ya da API_KEY sorgu parametresi olarak ileyerek kimlik doğrulaması yapar. API çağrıları yapmak için ayrıca tenantId değerine de ihtiyacınız olacaktır. Bu değer, api key ile aynı sayfadan alınabilir.

Güvenlik Notu

Bu yolların bir sunucudan çağrılması amaçlanmıştır. YAPMAYIN bunları bir tarayıcıdan çağırmayın. Bunu yapmak API key'inizi açığa çıkarır - bir sayfanın kaynak kodunu görebilen herkese hesabınıza tam erişim sağlar!

Kimlik Doğrulama Seçeneği Bir - Başlıklar

  • Başlık: X-API-KEY
  • Başlık: X-TENANT-ID

Kimlik Doğrulama Seçeneği İki - Sorgu Parametreleri

  • Sorgu Parametresi: API_KEY
  • Sorgu Parametresi: tenantId

AuditLog Yapısı Internal Link

Bir AuditLog, bu özelliğe erişimi olan kiracılar için denetlenmiş bir olayı temsil eden bir nesnedir.

AuditLog nesnesinin yapısı aşağıdaki gibidir:

AuditLog Yapısı
Copy Copy
1
2interface AuditLog {
3 id: string;
4 userId?: string;
5 username?: string;
6 resourceName: string;
7 crudType: 'c' | 'r' | 'u' | 'd' | 'login';
8 from: string;
9 url?: string;
10 ip?: string;
11 when: string;
12 description?: string;
13 serverStartDate: string;
14 objectDetails?: object;
15}
16

Denetim günlüğü değiştirilemez. Ayrıca elle yazılamaz. FastComments.com yalnızca denetim günlüğüne ne zaman yazılacağına karar verebilir. Ancak bu API aracılığıyla ondan okuyabilirsiniz.

Denetim günlüğündeki olayların geçerliliği iki yıl sonra sona erer.

Yorum Yapısı Internal Link

A Comment object represents a comment left by a user.

The relationship between parent and child comments is defined via parentId.

The structure for the Comment object is as follows:

Yorum Yapısı
Copy Copy
1
2interface Comment {
3 /** READONLY: Set to true if the spam engine determined the comment was spam. **/
4 aiDeterminedSpam?: boolean
5 /** Whether the comment is approved to show. Set to true when saving the comment, else it will be hidden. **/
6 approved?: boolean
7 /** The user's avatar. **/
8 avatarSrc?: string
9 /** Child comments. Not populated in all scenarios. Used when asTree is set to true via the API. **/
10 children: Comment[]
11 /** The commenter's raw comment. **/
12 comment: string
13 /** READONLY: The commenter's comment parsed into HTML. **/
14 commentHTML?: string
15 /** The commenter's email. Required if anonymous commenting is off. **/
16 commenterEmail?: string
17 /** The commenter's link (for example, their blog). **/
18 commenterLink?: string
19 /** The commenter's name. Always required. If not available, set to something like "Anonymous". **/
20 commenterName: string
21 /** The date the comment was left, in UTC epoch. **/
22 date: number
23 /** The "display label" for the comment - for example "Admin", "Moderator", or something like "VIP User". **/
24 displayLabel?: string
25 /** The domain the comment was posted on. **/
26 domain?: string
27 /** READONLY: The number of times the comment was flagged. **/
28 flagCount?: number
29 /** The #hashtags written in the comment that were successfully parsed. You can also manually add hashtags, for querying, but they won't display in the comment text automatically. **/
30 hashTags?: CommentHashTag[]
31 /** READONLY: Does the comment contain images? **/
32 hasImages?: boolean
33 /** READONLY: Does the comment contain links? **/
34 hasLinks?: boolean
35 /** READONLY: The unique comment id. **/
36 id: string
37 /** Only on create! This is hashed for storage. **/
38 ip?: string
39 /** READONLY: Did the current user block the user that wrote this comment? **/
40 isBlocked?: boolean
41 /** READONLY: Is the comment by an admin? Automatically set based on userId. **/
42 isByAdmin?: boolean
43 /** READONLY: Is the comment by a moderator? Automatically set based on userId. **/
44 isByModerator?: boolean
45 /** Set to true if the comment was soft deleted (placeholder had to be left due to some other configuration). **/
46 isDeleted?: boolean
47 /** Set to true if the user's account was deleted and the comment had to be retained. **/
48 isDeletedUser?: boolean
49 /** READONLY: Is the flagged by the currently logged-in user (contextUserId)? **/
50 isFlagged?: boolean
51 /** Is the comment pinned? **/
52 isPinned?: boolean
53 /** Is the comment locked for new replies (moderators still can reply)? **/
54 isLocked?: boolean
55 /** Is the comment spam? **/
56 isSpam?: boolean
57 /** READONLY: Is the comment voted down for the current user (contextUserId)? **/
58 isVotedDown?: boolean
59 /** READONLY: Is the comment voted up for the current user (contextUserId)? **/
60 isVotedUp?: boolean
61 /** The locale the comment is in. If not provided, will be derived from the language accept HTTP header. **/
62 locale?: 'de_de' | 'en_us' | 'es_es' | 'fr_fr' | 'it_it' | 'ja_jp' | 'ko_kr' | 'pl_pl' | 'pt_br' | 'ru_ru' | 'tr_tr' | 'zh_cn' | 'zh_tw'
63 /** READONLY: The @mentions written in the comment that were successfully parsed. **/
64 mentions?: CommentUserMention[]
65 /** Optional metadata associated with the comment. **/
66 meta?: Record<string, string | number | boolean>
67 /** The optional list of moderation group ids associated with this comment. **/
68 moderationGroupIds?: string[]|null
69 /** READONLY: The id of the vote object that corresponds to the vote from the current user (contextUserId) on this comment. **/
70 myVoteId?: string
71 /** Whether notifications were sent for this comment for commenters. To prevent notifications being sent on imports, set this to true. **/
72 notificationSentForParent?: boolean
73 /** Whether notifications were sent for this comment for tenant users. To prevent notifications being sent on imports, set this to true. **/
74 notificationSentForParentTenant?: boolean
75 /** The title of the page this comment was on. **/
76 pageTitle?: string
77 /** If we're replying to a comment, this is the ID that we are replying to. **/
78 parentId?: string|null
79 /** Whether the comment is marked reviewed. **/
80 reviewed: boolean
81 /** The tenant id where the comment belongs. **/
82 tenantId: string
83 /** The user that wrote the comment. Created automatically when saving a comment with a name/email. **/
84 userId?: string|null
85 /** The URL to the location that this comment is visible, like a blog post. **/
86 url: string
87 /** A "cleaned" version of the urlId you passed us. When saving, you specify this field, but when you fetch the comment back this will be "cleaned" and your original value moved to "urlIdRaw". **/
88 urlId: string
89 /** READONLY: The original urlId you passed us. **/
90 urlIdRaw?: string
91 /** Is the user and this comment verified? **/
92 verified: boolean
93 /** Number of votes up. **/
94 votesUp?: number
95 /** Number of votes down. **/
96 votesDown?: number
97 /** The "karma" of the comment (= votes up - votes down). **/
98 votes?: number
99}
100

Some of these fields are marked READONLY - these are returned by the API but cannot be set.

Comment Text Structure

Comments are written in a FastComments flavor of markdown, which is just markdown plus traditional bbcode style tags for images, like [img]path[/img].

Text is stored in two fields. The text the user entered is stored unmodified in the comment field. This is rendered and stored in the commentHTML field.

The allowed HTML tags are b, u, i, strike, pre, span, code, img, a, strong, ul, ol, li, and br.

It's recommended to render the HTML, since it is a very small subset of HTML, building a renderer is pretty straightforward. There are multiple libraries for React Native and Flutter, for instance, to help with this

You may choose to render the un-normalized value of the comment field. An example parser is here..

The example parser could also be adjusted to work with HTML, and transform the HTML tags into expected elements to render for your platform.

Tagging

When users are tagged in a comment, the information is stored in a list called mentions. Each object in that list has the following structure.

Yorumdaki Kullanıcı Etiketi Nesnesi
Copy CopyRun External Link
1
2interface CommentUserMention {
3 /** The user id. For SSO users, this will have your tenant id prefixed. **/
4 id: string
5 /** The final @mention tag text, including the @ symbol. **/
6 tag: string
7 /** The original @mention tag text, including the @ symbol. **/
8 rawTag: string
9 /** What type of user was tagged. user = FastComments.com account. sso = SSOUser. **/
10 type: 'user'|'sso'
11 /** If the user opts out of notifications, this will still be set to true. **/
12 sent: boolean
13}
14

HashTags

When hashtags are used and successfully parsed, the information is stored in a list called hashTags. Each object in that list has the following structure. Hashtags can also be manually added to the comment hashTags array for querying, if retain is set.

Yorum Hashtag Nesnesi
Copy CopyRun External Link
1
2interface CommentHashTag {
3 /** The hashtag id. **/
4 id: string
5 /** The final #hashtag tag text, including the # symbol. **/
6 tag: string
7 /** If the hashtag is associated with a custom URL, this will be defined. **/
8 url?: string
9 /** If we should retain the hashtag, even if it does not exist in the comment text, when the comment is updated. Useful for tagging comments without changing comment text. **/
10 retain?: boolean
11}
12

E-posta Şablonu Yapısı Internal Link


Bir EmailTemplate nesnesi, bir kiracı için özel bir e-posta şablonunun yapılandırmasını temsil eder.

Sistem, kullanılacak e-posta şablonunu şu yolla seçer:

  • Türünü belirten tanımlayıcı, buna emailTemplateId diyoruz. Bunlar sabittir.
  • domain. İlgili nesnenin (ör. bir Comment) bağlı olduğu domain için önce bir şablon bulmaya çalışacağız; eşleşme bulunmazsa domain'in null veya * olduğu bir şablon arayacağız.

EmailTemplate nesnesinin yapısı aşağıdaki gibidir:

E-posta Şablon Yapısı
Copy Copy
1
2interface EmailTemplate {
3 id: string
4 tenantId: string
5 emailTemplateId: string
6 displayName: string
7 /** SADECE OKUNUR **/
8 createdAt: string
9 /** SADECE OKUNUR **/
10 updatedAt: string
11 /** SADECE OKUNUR **/
12 updatedByUserId: string
13 /** Şablonun ilişkilendirileceği domain. **/
14 domain?: string | '*' | null
15 /** EJS sözdiziminde e-posta şablonu içeriği. **/
16 ejs: string
17 /** Her desteklenen yerel için geçersiz kılınmış çeviri anahtarlarının değerlerini içeren bir harita. **/
18 translationOverridesByLocale: Record<string, Record<string, string>>
19 /** Şablonun render bağlamını temsil eden bir nesne. **/
20 testData: object
21}
22

Notlar

  • Geçerli emailTemplateId değerlerini /definitions uç noktasından alabilirsiniz.
  • /definitions uç noktası ayrıca varsayılan çevirileri ve test verilerini içerir.
  • Geçersiz yapı veya test verileri durumunda şablonlar kaydedilemez.

Hashtag Yapısı Internal Link


Bir HashTag nesnesi, bir kullanıcı tarafından bırakılabilecek bir etiketi temsil eder. HashTags harici bir içeriğe bağlamak veya ilişkili yorumları birbirine bağlamak için kullanılabilir.

HashTag nesnesinin yapısı aşağıdaki gibidir:

HashTag Yapısı
Copy Copy
1
2interface HashTag {
3 /** "#" veya istenen karakterle başlamalı. **/
4 tag: string
5 /** Hashtag'in işaret edebileceği isteğe bağlı bir URL. Yorumları hashtag ile filtrelemek yerine, kullanıcı arayüzü tıklanınca buna yönlendirir. **/
6 url?: string
7 /** SADECE OKUNUR **/
8 createdAt: string
9}
10

Notlar:

  • Bazı API uç noktalarında hashtag'in URL içinde kullanıldığını göreceksiniz. Değerleri URI ile kodlamayı unutmayın. Örneğin, # yerine %23 olarak temsil edilmelidir.
  • Bu alanların bazıları READONLY olarak işaretlenmiştir - bunlar API tarafından döndürülür ancak ayarlanamaz.

Bildirim Sayısı Yapısı Internal Link

A NotificationCount object represents the unread notification count and metadata for a user.

If there are no unread notifications, there will be no NotificationCount for the user.

NotificationCount objects are created automatically and cannot be created via the API. They also expire after one year.

You can clear a user's unread notification count by deleting their NotificationCount.

The structure for the NotificationCount object is as follows:

NotificationCount Yapısı
Copy Copy
1
2interface NotificationCount {
3 id: string // kullanıcı kimliği
4 count: number
5 createdAt: string // tarih dizesi
6 expireAt: string // tarih dizesi
7}
8

Bildirim Yapısı Internal Link

A Notification object represents a notification for a user.

Notification objects are created automatically and cannot be created via the API. They also expire after one year. Notifications cannot be deleted. They can however be updated to set viewed to false, and you can query by viewed.

A user may also opt out of notifications for a specific comment by setting optedOut in the notification to true. You can opt in again by setting it to false.

There are different notification types - check relatedObjectType and type.

The ways notifications are created is quite flexible and can be triggered by many scenarios (see NotificationType).

As of today, the existence of a Notification does not actually imply an email is or should be sent. Rather, the notifications are used for the notification feed and related integrations.

The structure for the Notification object is as follows:

Bildirim Yapısı
Copy Copy
1
2enum NotificationObjectType {
3 Comment = 0,
4 Profile = 1,
5 Tenant = 2
6}
7
8enum NotificationType {
9 /** Birisi size yanıt verdiğinde. **/
10 RepliedToMe = 0,
11 /** Birisi, yorum yaptığınız bir dizide (alt diziler dahil) herhangi bir yere yanıt verdiğinde. **/
12 RepliedTransientChild = 1,
13 /** Yorumunuza oy verildiğinde. **/
14 VotedMyComment = 2,
15 /** Abone olduğunuz bir sayfanın köküne yeni bir yorum bırakıldığında. **/
16 SubscriptionReplyRoot = 3,
17 /** Birisi profilinize yorum yaptığında. **/
18 CommentedOnProfile = 4,
19 /** Size bir DM geldiğinde. **/
20 DirectMessage = 5,
21 /** TrialLimits yalnızca tenant kullanıcıları için. **/
22 TrialLimits = 6,
23 /** Eğer size @ ile bahsedildiyse. **/
24 Mentioned = 7
25}
26
27interface Notification {
28 id: string
29 tenantId: string
30 /** SSO ile, kullanıcı kimliği formatı `<tenant id>:<user id>` şeklindedir. **/
31 userId?: string
32 /** SSO ile çalışırken yalnızca `userId` ile ilgilenmeniz gerekir. **/
33 anonUserId?: string
34 /** urlId neredeyse her zaman tanımlıdır. Yalnızca tenant düzeyindeki bildirimler için isteğe bağlıdır; bunlar nadirdir. **/
35 urlId?: string
36 /** Bildirimin kaynağına hızlı gezinme için URL önbelleğe alınır. **/
37 url?: string
38 /** Bildirim kaynağının hızlı okunması için sayfa başlığı önbelleğe alınır. **/
39 pageTitle?: string
40 relatedObjectType: NotificationObjectType
41 /** Örneğin, yorum kimliği. **/
42 relatedObjectId: string
43 viewed: boolean
44 createdAt: string // tarih dizesi
45 type: NotificationType
46 fromCommentId?: string
47 fromVoteId?: string
48 /** fromUserName ve fromUserAvatarSrc bildirimin hızlı görüntülenmesi için burada önbelleğe alınır. Kullanıcı güncellendiğinde güncellenirler. **/
49 fromUserName: string
50 fromUserId: string
51 fromUserAvatarSrc?: string
52 /** Bu nesne için bildirim almamak için bunu true olarak ayarlayın. **/
53 optedOut?: boolean
54}
55

Sayfa Yapısı Internal Link

Bir Page nesnesi, birçok yorumun ait olabileceği sayfayı temsil eder. Bu ilişki şu şekilde tanımlanır urlId.

Bir Page, sayfa başlığı, yorum sayısı ve urlId gibi bilgileri saklar.

Page nesnesinin yapısı aşağıdaki gibidir:

Sayfa Yapısı
Copy Copy
1
2interface Page {
3 id: string
4 urlId: string
5 url: string
6 title?: string
7 createdAt: string
8 commentCount: number
9 rootCommentCount: number
10 /** Bunu null olarak ayarlamak, tüm SSO kullanıcılarının sayfayı görebileceği anlamına gelir. Boş bir liste ise tüm kullanıcılara kapalı olduğu anlamına gelir. **/
11 accessibleByGroupIds?: string[] | null
12 /** Bu sayfa yeni yorumlara kapalı mı? **/
13 isClosed?: boolean
14}
15

Bekleyen Webhook Olayı Yapısı Internal Link

A PendingWebhookEvent object represents a queued webhook event that is pending.

PendingWebhookEvent objects are created automatically and cannot be manually created via the API. They also expire after one year. They can be deleted which removes the task from the queue.

There are different event types - check eventType (OutboundSyncEventType) and type (OutboundSyncType).

A common use case for this API is to implement custom monitoring. You may want to call the /count endpoint periodically to poll the outstanding count for given filters.

The structure for the PendingWebhookEvent object is as follows:

PendingWebhookEvent Yapısı
Copy Copy
1
2enum OutboundSyncEventType {
3 Create: 0,
4 Delete: 1,
5 Update: 2
6}
7
8enum OutboundSyncType {
9 /** WordPress'e özgü senkronizasyon görevi. **/
10 WP: 0,
11 Webhook: 1
12}
13
14interface PendingWebhookEvent {
15 id: string
16 /** Olayla ilişkili yorum kimliği. **/
17 commentId: string
18 /** Olay anındaki yorum nesnesi. Bunları Kasım 2023'te eklemeye başladık. **/
19 comment: Comment
20 /** Yorumla ilişkilendirilebilecek harici bir kimlik. **/
21 externalId: string | null
22 createdAt: Date
23 tenantId: string
24 attemptCount: number
25 /** İlk denemeden önce ve her hata sonrası ayarlanır. **/
26 nextAttemptAt: Date
27 /** Bunun bir oluşturma, silme veya güncelleme olayı olup olmadığı... **/
28 eventType: OutboundSyncEventType
29 /** Yapılacak senkronizasyon türü (WordPress, API çağrısı, vb.). **/
30 type: OutboundSyncType
31 /** Yorumla eşleşen alan adı. API anahtarını seçmek için bu alan adını kullanıyoruz. **/
32 domain: string
33 /** Oluşan son hata. Bu tür tiplenmemiştir ve olanların bir "dump"ıdır. Genellikle statusCode, body ve bir headers haritası içeren bir nesne içerir. **/
34 lastError: object | null
35}
36

SSO Kullanıcısı Yapısı Internal Link

FastComments provides an easy to use SSO solution. Updating a user's information with the HMAC-based integration is as simple as having the user load the page with an updated payload.

However, it may be desirable to manage a user outside that flow, to improve consistency of your application.

The SSO User API provides a way to CRUD objects that we call SSOUsers. These objects are different from regular Users and kept separate for type safety.

The structure for the SSOUser object is as follows:

SSOUser Yapısı
Copy Copy
1
2interface SSOUser {
3 id: string
4 username: string
5 email?: string
6 websiteUrl?: string
7 signUpDate: number
8 createdFromUrlId?: string
9 loginCount?: number
10 avatarSrc?: string
11 optedInNotifications?: boolean
12 optedInSubscriptionNotifications?: boolean
13 displayLabel?: string
14 displayName?: string
15 isAccountOwner?: boolean // Yönetici izni - Bu bayrağa sahip SSO kullanıcıları SSO Admins olarak faturalandırılır (normal SSO kullanıcılarından ayrı)
16 isAdminAdmin?: boolean // Yönetici izni - Bu bayrağa sahip SSO kullanıcıları SSO Admins olarak faturalandırılır (normal SSO kullanıcılarından ayrı)
17 isCommentModeratorAdmin?: boolean // Moderatör izni - Bu bayrağa sahip SSO kullanıcıları SSO Moderators olarak faturalandırılır (normal SSO kullanıcılarından ayrı)
18 /** Eğer null ise, Erişim Kontrolü kullanıcıya uygulanmaz. Eğer boş bir liste ise, bu kullanıcı herhangi bir sayfayı göremeyecek veya diğer kullanıcıları @mention yapamayacaktır. **/
19 groupIds?: string[] | null
20 createdFromSimpleSSO?: boolean
21 /** Diğer kullanıcıların bu kullanıcının profilindeki etkinlikleri, yorumlar dahil, görmesini engelle. Varsayılan olarak güvenli profiller sağlamak için true'dur. **/
22 isProfileActivityPrivate?: boolean
23 /** Diğer kullanıcıların kullanıcının profiline yorum bırakmasını veya mevcut profil yorumlarını görmesini engelle. Varsayılan false. **/
24 isProfileCommentsPrivate?: boolean
25 /** Diğer kullanıcıların bu kullanıcıya doğrudan mesaj göndermesini engelle. Varsayılan false. **/
26 isProfileDMDisabled?: boolean
27 karma?: number
28 /** Kullanıcı rozetleri için isteğe bağlı yapılandırma. **/
29 badgeConfig?: {
30 /** Kullanıcıya atanacak rozet ID'lerinden oluşan dizi. 30 rozet ile sınırlıdır. Sıra korunur. **/
31 badgeIds: string[]
32 /** Eğer true ise, görüntülenen mevcut tüm rozetleri sağlananlarla değiştirir. Eğer false ise mevcut rozetlere ekler. **/
33 override?: boolean
34 /** Eğer true ise, rozet görüntü özelliklerini kiracı yapılandırmasından günceller. **/
35 update?: boolean
36 }
37}
38

Billing for SSO Users

SSO users are billed differently based on their permission flags:

  • Regular SSO Users: Users without admin or moderator permissions are billed as regular SSO users
  • SSO Admins: Users with isAccountOwner or isAdminAdmin flags are billed separately as SSO Admins (same rate as regular tenant admins)
  • SSO Moderators: Users with isCommentModeratorAdmin flag are billed separately as SSO Moderators (same rate as regular moderators)

Important: To prevent double billing, the system automatically deduplicates SSO users against regular tenant users and moderators by email address. If an SSO user has the same email as a regular tenant user or moderator, they will not be billed twice.

Access Control

Users can be broken into groups. This is what the groupIds field is for, and is optional.

@Mentions

By default @mentions will use username to search for other sso users when the @ character is typed. If displayName is used, then results matching username will be ignored when there is a match for displayName, and the @mention search results will use displayName.

Subscriptions

With FastComments, users can subscribe to a page by clicking the bell icon in the comment widget and clicking Subscribe.

With a regular user, we send them notification emails based on their notification settings.

With SSO Users, we split this up for backwards compatibility. Users will only get sent these additional subscription notification emails if you set optedInSubscriptionNotifications to true.

Badges

You can assign badges to SSO users using the badgeConfig property. Badges are visual indicators that appear next to a user's name in comments.

  • badgeIds - An array of badge IDs to assign to the user. These must be valid badge IDs created in your FastComments account. Limited to 30 badges.
  • override - If true, all existing badges displayed on comments will be replaced with the provided ones. If false or omitted, the provided badges will be added to any existing badges.
  • update - If true, badge display properties will be updated from the tenant configuration whenever the user logs in.

Abonelik Yapısı Internal Link

A Subscription object represents a subscription for a user.

Subscription objects are created when a user clicks the notification bell in the comment widget and clicks "Bu sayfaya abone ol".

Subscriptions can also be created via the API.

Having a Subscription object causes Notification objects to be generated, and emails sent, when new comments are left on the root of the associated page that the Subscription is for. Sending of emails depends on the type of user. For regular users this depends on optedInNotifications. For SSO Users this depends on optedInSubscriptionNotifications. Note that some applications may not have the concept of a web-accessible page, in which case simply set urlId to the id of the item you are subscribing to (same value for urlId you would pass to the comment widget).

The structure for the Subscription object is as follows:

Abonelik Yapısı
Copy Copy
1
2interface Subscription {
3 id: string
4 tenantId: string
5 /** SSO ile, kullanıcı kimliği `<tenant id>:<user id>` formatındadır. **/
6 userId: string
7 anonUserId?: string
8 urlId: string
9 url?: string
10 pageTitle?: string
11 createdAt: string // tarih dizesi
12}
13

Kiracı Günlük Kullanım Yapısı Internal Link


Bir TenantDailyUsage nesnesi, belirli bir gün için bir kiracının kullanımını temsil eder. Eğer belirli bir kiracı için belirli bir günde hiçbir etkinlik yoksa, o gün için bir TenantDailyUsage nesnesi olmayacaktır.

The TenantDailyUsage object is not real time and may be minutes behind actual usage.

The structure for the TenantDailyUsage object is as follows:

TenantDailyUsage Yapısı
Copy Copy
1
2export interface TenantDailyUsage {
3 yearNumber: number
4 monthNumber: number
5 dayNumber: number
6 commentFetchCount?: number
7 commentCreateCount?: number
8 conversationCreateCount?: number
9 voteCount?: number
10 accountCreatedCount?: number
11 userMentionSearch?: number
12 hashTagSearch?: number
13 gifSearchTrending?: number
14 gifSearch?: number
15 apiCreditsUsed?: number
16 createdAt: string
17 billed: boolean
18 /** Faturalama için dikkate alınmaz. **/
19 ignored: boolean
20}
21

Kiracı Yapısı Internal Link


Tenant, FastComments.com müşterisini tanımlar. Bunlar API aracılığıyla white-label erişimine sahip kiracılar tarafından oluşturulabilir. White-label kiracılar başka white-label kiracılar oluşturamaz (sadece bir düzey iç içe izin verilir).

Tenant nesnesinin yapısı aşağıdaki gibidir:

Tenant Yapısı
Copy Copy
1
2export enum SiteType {
3 Unknown = 0,
4 WordPress = 1
5}
6
7/** Bu, DomainConfig API aracılığıyla da işlenebilir. **/
8export interface TenantDomainConfig {
9 domain: string
10 emailFromName?: string
11 emailFromEmail?: string
12 createdAt?: string,
13 siteType?: FastCommentsSiteType, // muhtemelen Unknown kullanmak istersiniz
14 logoSrc?: string, // ham resim yolu
15 logoSrc100px?: string, // küçük resimler için yeniden boyutlandırılmış
16 footerUnsubscribeURL?: string,
17 emailHeaders?: Record<string, string>,
18 disableUnsubscribeLinks?: boolean,
19 dkim?: {
20 domainName: string,
21 keySelector: string,
22 privateKey: string
23 }
24}
25
26export interface TenantBillingInfo {
27 name: string
28 address: string
29 city: string
30 state: string
31 zip: string
32 country: string
33}
34
35export enum TenantPaymentFrequency {
36 Monthly = 0,
37 Annually = 1
38}
39
40export interface Tenant {
41 id: string
42 name: string
43 email?: string
44 signUpDate: number; // sayı, "legacy" nedenlerden dolayı
45 packageId?: string | null
46 paymentFrequency?: TenantPaymentFrequency
47 billingInfoValid?: boolean
48 billingHandledExternally?: boolean
49 createdBy?: string
50 isSetup?: boolean
51 domainConfiguration: FastCommentsAPITenantDomainConfig[]
52 billingInfo?: FastCommentsAPITenantBillingInfo
53 stripeCustomerId?: string
54 stripeSubscriptionId?: string
55 stripePlanId?: string
56 enableProfanityFilter?: boolean
57 enableSpamFilter?: boolean
58 lastBillingIssueReminderDate?: string
59 removeUnverifiedComments?: boolean
60 unverifiedCommentsTTLms?: number
61 commentsRequireApproval?: boolean
62 autoApproveCommentOnVerification?: boolean
63 sendProfaneToSpam?: boolean
64 /** @readonly - packageId'ye göre hesaplanır. **/
65 hasFlexPricing?: boolean
66 /** @readonly **/
67 flexLastBilledAmount?: number
68 /** @readonly - packageId'ye göre hesaplanır. **/
69 hasAuditing?: boolean
70 /** Kiracıyla sorgulamada kullanabileceğiniz bir anahtar-değer çifti saklayabilirsiniz. Anahtarlar "." veya "$" içeremez veya 100 karakterden uzun olamaz. Değerler 2k karakterden uzun olamaz. **/
71 meta?: Record<string, string | null>
72}
73

Kullanıcı Yapısı Internal Link

User tüm kullanıcı türlerinin en yaygın ortak paydasını temsil eden bir nesnedir.

Unutmayın ki FastComments'ta kullanıcılar için birçok farklı kullanım durumu bulunur:

  • Secure SSO
  • Simple SSO
  • Tenant Users (Örneğin: Yöneticiler)
  • Commenters

Bu API Commenters ve Simple SSO aracılığıyla oluşturulan kullanıcılar içindir. Temelde, siteniz üzerinden oluşturulan herhangi bir kullanıcıya bu API aracılığıyla erişilebilir. Tenant Users da bu şekilde alınabilir, ancak /tenant-users/ API'si ile etkileşime girerek daha fazla bilgi edinebilirsiniz.

Secure SSO için lütfen /sso-users/ API'sini kullanın.

Bu tür kullanıcıları güncelleyemezsiniz. Hesaplarını siteniz aracılığıyla oluşturmuşlardır, bu yüzden temel bazı salt okunur erişim sağlıyoruz, ancak değişiklik yapamazsınız. Bu tür bir akışa sahip olmak istiyorsanız - Secure SSO'yu kurmanız gerekir.

User nesnesinin yapısı aşağıdaki gibidir:

Kullanıcı Yapısı
Copy Copy
1
2export interface User {
3 /** Bu, yorum nesnelerindeki userId olarak da kullanılan id'dir. **/
4 id: string
5 username: string
6 /** Örneğin yorumcunun bloguna bir bağlantı. **/
7 websiteUrl?: string
8 email: string
9 signUpDate: number
10 createdFromUrlId: string
11 createdFromTenantId: string
12 avatarSrc?: string
13 locale: FastCommentsLocale
14 displayLabel?: string
15 karma?: number
16}
17

Oy Yapısı Internal Link


Bir Vote nesnesi, bir kullanıcı tarafından bırakılan bir oyu temsil eder.

Yorumlar ile oy arasındaki ilişki commentId aracılığıyla tanımlanır.

Vote nesnesinin yapısı aşağıdaki gibidir:

Vote Yapısı
Copy Copy
1
2interface Vote {
3 id: string
4 urlId: string
5 commentId: string
6 userId: string
7 direction: 1 | -1
8 createdAt: string
9}
10

Soru Yapılandırması Yapısı Internal Link

FastComments, soru oluşturma ve bunların sonuçlarını toplama yolu sağlar. Bir soru örneği (bundan sonra QuestionConfig olarak anılacaktır) yıldız derecelendirmesi, bir kaydırıcı veya bir NPS sorusu olabilir (type ile belirlenir).

Soru verileri ayrı ayrı, birlikte, zaman içinde, genel olarak, sayfaya göre vb. şekilde toplanabilir.

Bu çerçeve, istemci tarafı widget'ları (bu API'nin önünde sunucunuzla), yönetici panolarını ve raporlama araçlarını oluşturmak için gereken tüm yeteneklere sahiptir.

İlk olarak bir QuestionConfig tanımlamamız gerekiyor. Yapısı şu şekildedir:

QuestionConfig Yapısı
Copy Copy
1
2type QuestionConfigType = 'nps' | 'slider' | 'star' | 'thumbs';
3
4interface QuestionConfig {
5 id: string
6 tenantId: string
7 name: string
8 question: string
9 helpText?: string
10 createdAt: string
11 createdBy: string
12 /** SADECE OKUNUR - her yeni yanıta göre artırılır. **/
13 usedCount: number
14 /** Yapılandırmanın en son ne zaman kullanıldığına (sonucun bırakıldığı) dair bir tarih dizgesi. **/
15 lastUsed?: string
16 type: QuestionConfigType
17 numStars?: number
18 min?: number
19 max?: number
20 defaultValue?: number
21 labelNegative?: string
22 labelPositive?: string
23 subQuestionIds?: string[]
24 alwaysShowSubQuestions?: boolean
25 reportingOrder: number
26}
27

Soru Sonucu Yapısı Internal Link

Sorular için sonuçları kaydetmek amacıyla bir QuestionResult oluşturursunuz. Ardından soru sonuçlarını toplu hâlde işleyebilir ve raporlama amaçları için yorumlara bağlayabilirsiniz.

QuestionResult Yapısı
Copy Copy
1
2interface QuestionResultMeta {
3 name: string
4 values: string[]
5}
6
7interface QuestionResult {
8 id: string
9 tenantId: string
10 urlId: string
11 anonUserId?: string
12 userId?: string
13 createdAt?: string
14 value: number
15 commentId?: string
16 questionId: string
17 meta?: QuestionResultMeta[]
18}
19

Kullanıcı Rozeti Yapısı Internal Link

UserBadge FastComments sisteminde bir kullanıcıya atanan bir rozeti temsil eden bir nesnedir.

Rozetler, kullanıcı etkinliğine (such as comment count, reply time, veteran status) göre otomatik olarak veya site yöneticileri tarafından elle atanabilir.

The structure for theUserBadgeobject is as follows: -> UserBadge nesnesinin yapısı aşağıdaki gibidir:

UserBadge Yapısı
Copy Copy
1
2export interface UserBadge {
3 /** Bu kullanıcı rozet atamasının benzersiz tanımlayıcı */
4 id: string
5 /** Bu rozetin atandığı kullanıcının ID'si */
6 userId: string
7 /** Kiracının rozet kataloğundan rozet tanımının ID'si */
8 badgeId: string
9 /** Bu rozeti oluşturan/atan kiracının ID'si */
10 fromTenantId: string
11 /** Bu rozetin oluşturulduğu zaman (epoch'tan bu yana milisaniye) */
12 createdAt?: number
13 /** Bu rozetin kullanıcı tarafından alındığı zaman (epoch'tan bu yana milisaniye) */
14 receivedAt?: number
15 /**
16 * Rozet türü:
17 * 0=CommentCount, 1=CommentUpVotes, 2=CommentReplies, 3=CommentsPinned,
18 * 4=Veteran, 5=NightOwl, 6=FastReplyTime, 7=ModeratorCommentsDeleted,
19 * 8=ModeratorCommentsApproved, 9=ModeratorCommentsUnapproved, 10=ModeratorCommentsReviewed,
20 * 11=ModeratorCommentsMarkedSpam, 12=ModeratorCommentsMarkedNotSpam, 13=RepliedToSpecificPage,
21 * 14=Manual
22 */
23 type: number
24 /** Eşiğe dayalı rozetler için eşik değeri */
25 threshold?: number
26 /** Rozetin adı/etiketi */
27 name?: string
28 /** Rozetin ayrıntılı açıklaması */
29 description?: string
30 /** Rozette gösterilen metin */
31 displayLabel?: string
32 /** Rozette gösterilen resmin URL'si */
33 displaySrc?: string
34 /** Rozet için arka plan rengi (hex kodu) */
35 backgroundColor?: string
36 /** Rozet için kenarlık rengi (hex kodu) */
37 borderColor?: string
38 /** Rozet için metin rengi (hex kodu) */
39 textColor?: string
40 /** Stil için ek CSS sınıfı */
41 cssClass?: string
42 /** Veteran rozetleri için zaman eşiği (milisaniye) */
43 veteranUserThresholdMillis?: number
44 /** Bu rozetin kullanıcının yorumlarında görüntülenip görüntülenmediği */
45 displayedOnComments: boolean
46 /** Rozetin gösterim sırası */
47 order?: number
48}
49

Kullanıcı Rozet İlerleme Yapısı Internal Link

UserBadgeProgress is an object that represents a user's progress toward earning various badges in the FastComments system.

This tracking helps determine when users should receive automatic badges based on their activity and participation in your community.

The structure for the UserBadgeProgress object is as follows:

UserBadgeProgress Yapısı
Copy Copy
1
2export interface UserBadgeProgress {
3 /** Bu ilerleme kaydı için benzersiz tanımlayıcı */
4 id: string
5 /** Bu ilerleme kaydının ait olduğu tenant ID'si */
6 tenantId: string
7 /** Bu ilerleme kaydının izlediği kullanıcının ID'si */
8 userId: string
9 /** Kullanıcının sistemdeki ilk yorumunun ID'si */
10 firstCommentId?: string
11 /** Kullanıcının ilk yorumunun tarihi (epoch'ten itibaren milisaniye cinsinden) */
12 firstCommentDate?: number
13 /** Kullanıcı etkinliğine göre otomatik hesaplanan güven faktörü */
14 autoTrustFactor?: number
15 /** Yöneticiler tarafından manuel olarak ayarlanan güven faktörü */
16 manualTrustFactor?: number
17 /** Çeşitli metrikler içeren ayrıntılı ilerleme nesnesi, anahtarlar BadgeType enum ile eşleşir */
18 progress: {
19 /** 0: CommentCount - Kullanıcının yaptığı yorum sayısı */
20 '0'?: number
21 /** 1: CommentUpVotes - Kullanıcının aldığı beğeni (upvote) sayısı */
22 '1'?: number
23 /** 2: CommentReplies - Kullanıcının yaptığı yanıt sayısı */
24 '2'?: number
25 /** 3: CommentsPinned - Kullanıcının sabitlenen yorum sayısı */
26 '3'?: number
27 /** 4: Veteran - Kullanıcının hesap yaşı */
28 '4'?: number
29 /** 5: NightOwl - Kullanıcının gece saatlerinde yorum yaptığı kez sayısı */
30 '5'?: number
31 /** 6: FastReplyTime - Ortalama yanıt süresi (milisaniye) */
32 '6'?: number
33 /** 7: ModeratorCommentsDeleted - Moderatör rozetleri için, silinen yorum sayısı */
34 '7'?: number
35 /** 8: ModeratorCommentsApproved - Moderatör rozetleri için, onaylanan yorum sayısı */
36 '8'?: number
37 /** 9: ModeratorCommentsUnapproved - Moderatör rozetleri için, onaydan çıkarılan yorum sayısı */
38 '9'?: number
39 /** 10: ModeratorCommentsReviewed - Moderatör rozetleri için, incelenen yorum sayısı */
40 '10'?: number
41 /** 11: ModeratorCommentsMarkedSpam - Moderatör rozetleri için, spam olarak işaretlenen yorum sayısı */
42 '11'?: number
43 /** 12: ModeratorCommentsMarkedNotSpam - Moderatör rozetleri için, spam olmayan olarak işaretlenen yorum sayısı */
44 '12'?: number
45 /** 13: RepliedToSpecificPage - Her sayfa için, yanıt sayıları */
46 '13'?: Record<string, number>
47 }
48}
49
---

Sonuç olarak

API belgelerimizin kapsamlı ve anlaşılması kolay olduğunu umuyoruz. Herhangi bir eksiklik bulursanız, lütfen aşağıdan bize bildirin.