FastComments.com

ื”-API ืฉืœ FastComments

FastComments ืžืกืคืงืช API ืœืื™ื ื˜ืจืืงืฆื™ื” ืขื ืžืฉืื‘ื™ื ืจื‘ื™ื. ื‘ื ื• ืื™ื ื˜ื’ืจืฆื™ื•ืช ืขื ื”ืคืœื˜ืคื•ืจืžื” ืฉืœื ื•, ืื• ืืคื™ืœื• ื‘ื ื• ืœืงื•ื—ื•ืช ืžืฉืœื›ื!

ื‘ืชื™ืขื•ื“ ื–ื” ืชืžืฆืื• ืืช ื›ืœ ื”ืžืฉืื‘ื™ื ื”ื ืชืžื›ื™ื ืขืœึพื™ื“ื™ ื”-API ื”ืžืชื•ืขื“ื™ื ืขื ืกื•ื’ื™ ื”ื‘ืงืฉื•ืช ื•ื”ืชืฉื•ื‘ื•ืช ืฉืœื”ื.

ืขื‘ื•ืจ ืœืงื•ื—ื•ืช ืืจื’ื•ื ื™ื™ื, ื›ืœ ื”ื’ื™ืฉื” ืœ-API ืžืชื•ืขื“ืช ื‘ื™ื•ืžืŸ ื”ื‘ื™ืงื•ืจืช.

SDKs ืฉื ื•ืฆืจื•

ื›ืขืช FastComments ืžื™ื™ืฆืจืช ืžืคืจื˜ API ืžืงื•ื“ ื”ืžืงื•ืจ ืฉืœื ื• (ื–ื” ืขื“ื™ื™ืŸ ืœื ืฉืœื, ืืš ื›ื•ืœืœ ืจื‘ื•ืช ืžื”-APIs).

ื›ืžื• ื›ืŸ, ื™ืฉ ืœื ื• ื›ืขืช SDKs ืœืฉืคื•ืช ืคื•ืคื•ืœืจื™ื•ืช:

ืื™ืžื•ืช

ื”-API ืžืื•ืžืช ืขืœ ื™ื“ื™ ื”ืขื‘ืจืช ืžืคืชื— ื”-API ื›ืื—ืช ืžืืœื”: ื›ื•ืชืจืช X-API-KEY ืื• ืคืจืžื˜ืจ ืฉืื™ืœืชื” API_KEY. ื‘ื ื•ืกืฃ ืชื–ื“ืงืงื• ืœ-tenantId ื›ื“ื™ ืœื‘ืฆืข ืงืจื™ืื•ืช API. ื ื™ืชืŸ ืœื”ืฉื™ื’ ื–ืืช ืžืื•ืชื” ืขืžื•ื“ ืฉื‘ื• ื ืžืฆื ืžืคืชื— ื”-API ืฉืœื›ื.

ื”ืขืจืช ืื‘ื˜ื—ื”

ื ืชื™ื‘ื™ื ืืœื• ืžื™ื•ืขื“ื™ื ืœื”ื™ืงืจื ืžืฉืจืช. ืืœ ืชืงืจืื• ืื•ืชื ืžื“ืคื“ืคืŸ. ืคืขื•ืœื” ื–ื• ืชื—ืฉื•ืฃ ืืช ืžืคืชื— ื”-API ืฉืœื›ื - ื–ื” ื™ืกืคืง ื’ื™ืฉื” ืžืœืื” ืœื—ืฉื‘ื•ืŸ ืฉืœื›ื ืœื›ืœ ืžื™ ืฉื™ื›ื•ืœ ืœืฆืคื•ืช ื‘ืงื•ื“ ื”ืžืงื•ืจ ืฉืœ ื“ืฃ!

Authentication Option One - Headers

  • ื›ื•ืชืจืช: X-API-KEY
  • ื›ื•ืชืจืช: X-TENANT-ID

Authentication Option Two - Query Parameters

  • ืคืจืžื˜ืจ ืฉืื™ืœืชื”: API_KEY
  • ืคืจืžื˜ืจ ืฉืื™ืœืชื”: tenantId

ืžื‘ื ื” ื™ื•ืžืŸ ื‘ื™ืงื•ืจืช Internal Link

ืื•ื‘ื™ื™ืงื˜ AuditLog ืžื™ื™ืฆื’ ืื™ืจื•ืข ืžื‘ื•ืงืจ ืขื‘ื•ืจ ืฉื•ื›ืจื™ื ืฉื™ืฉ ืœื”ื ื’ื™ืฉื” ืœืชื›ื•ื ื” ื–ื•.

ื”ืžื‘ื ื” ืขื‘ื•ืจ ืื•ื‘ื™ื™ืงื˜ AuditLog ื”ื•ื ื›ื“ืœืงืžืŸ:

ืžื‘ื ื” AuditLog
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

ื™ื•ืžืŸ ื”ื‘ื™ืงื•ืจืช ื”ื•ื ื‘ืœืชื™ ื ื™ืชืŸ ืœืฉื™ื ื•ื™. ื’ื ืœื ื ื™ืชืŸ ืœื›ืชื•ื‘ ืืœื™ื• ื™ื“ื ื™ืช. FastComments.com ืขืฉื•ื™ ืœื”ื—ืœื™ื˜ ืžืชื™ ืœื›ืชื•ื‘ ืœื™ื•ืžืŸ ื”ื‘ื™ืงื•ืจืช. ืขื ื–ืืช, ืืชื” ื™ื›ื•ืœ ืœืงืจื•ื ืžืžื ื• ื“ืจืš API ื–ื”.

ืื™ืจื•ืขื™ื ื‘ื™ื•ืžืŸ ื”ื‘ื™ืงื•ืจืช ืคื’ื™ื ืœืื—ืจ ืฉื ืชื™ื™ื.

ืžื‘ื ื” ืชื’ื•ื‘ื” Internal Link

ืื•ื‘ื™ื™ืงื˜ Comment ืžื™ื™ืฆื’ ืชื’ื•ื‘ื” ืฉื”ื•ืฉืืจื” ืขืœ ื™ื“ื™ ืžืฉืชืžืฉ.

ื”ื™ื—ืก ื‘ื™ืŸ ืชื’ื•ื‘ื•ืช ื”ื•ืจื” ื•ื™ืœื“ ืžื•ื’ื“ืจ ื‘ืืžืฆืขื•ืช parentId.

ื”ืžื‘ื ื” ืขื‘ื•ืจ ืื•ื‘ื™ื™ืงื˜ Comment ื”ื•ื ื›ื“ืœืงืžืŸ:

ืžื‘ื ื” ืชื’ื•ื‘ื”
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

ื—ืœืง ืžื”ืฉื“ื•ืช ื”ืœืœื• ืžืกื•ืžื ื™ื ื›-READONLY - ืืœื” ืžื•ื—ื–ืจื™ื ืขืœ ื™ื“ื™ ื”-API ืื‘ืœ ืœื ื ื™ืชืŸ ืœื”ื’ื“ื™ืจ ืื•ืชื.

ืžื‘ื ื” ื˜ืงืกื˜ ื”ืชื’ื•ื‘ื”

ืชื’ื•ื‘ื•ืช ื ื›ืชื‘ื•ืช ื‘ื’ืจืกืช FastComments ืฉืœ markdown, ืฉื”ื™ื ืคืฉื•ื˜ markdown ื‘ืชื•ืกืคืช ืชื’ื™ื•ืช ื‘ืกื’ื ื•ืŸ bbcode ืžืกื•ืจืชื™ ืœืชืžื•ื ื•ืช, ื›ืžื• [img]path[/img].

ื”ื˜ืงืกื˜ ืžืื•ื—ืกืŸ ื‘ืฉื ื™ ืฉื“ื•ืช. ื”ื˜ืงืกื˜ ืฉื”ืžืฉืชืžืฉ ื”ื–ื™ืŸ ืžืื•ื—ืกืŸ ืœืœื ืฉื™ื ื•ื™ ื‘ืฉื“ื” comment. ื–ื” ืžืจื•ื ื“ืจ ื•ืžืื•ื—ืกืŸ ื‘ืฉื“ื” commentHTML.

ืชื’ื™ื•ืช ื”-HTML ื”ืžื•ืชืจื•ืช ื”ืŸ b, u, i, strike, pre, span, code, img, a, strong, ul, ol, li, ื•-br.

ืžื•ืžืœืฅ ืœืจื ื“ืจ ืืช ื”-HTML, ืžื›ื™ื•ื•ืŸ ืฉื–ื• ืชืช-ืงื‘ื•ืฆื” ืงื˜ื ื” ืžืื•ื“ ืฉืœ HTML, ื‘ื ื™ื™ืช ืจื ื“ืจืจ ื”ื™ื ื“ื™ ืคืฉื•ื˜ื”. ื™ืฉื ืŸ ืžืกืคืจ ืกืคืจื™ื•ืช ืœ-React Native ื•-Flutter, ืœื“ื•ื’ืžื”, ืฉืขื•ื–ืจื•ืช ื‘ื›ืš.

ืืชื” ื™ื›ื•ืœ ืœื‘ื—ื•ืจ ืœืจื ื“ืจ ืืช ื”ืขืจืš ื”ืœื-ืžื ื•ืจืžืœ ืฉืœ ืฉื“ื” comment. ื“ื•ื’ืžืช ืคืจืกืจ ื ืžืฆืืช ื›ืืŸ..

ื ื™ืชืŸ ื’ื ืœื”ืชืื™ื ืืช ื“ื•ื’ืžืช ื”ืคืจืกืจ ืœืขื‘ื•ื“ื” ืขื HTML, ื•ืœื”ืžื™ืจ ืืช ืชื’ื™ื•ืช ื”-HTML ืœืืœืžื ื˜ื™ื ืฆืคื•ื™ื™ื ืœืจื ื“ื•ืจ ืขื‘ื•ืจ ื”ืคืœื˜ืคื•ืจืžื” ืฉืœืš.

ืชื™ื•ื’

ื›ืืฉืจ ืžืฉืชืžืฉื™ื ืžืชื•ื™ื’ื™ื ื‘ืชื’ื•ื‘ื”, ื”ืžื™ื“ืข ืžืื•ื—ืกืŸ ื‘ืจืฉื™ืžื” ื‘ืฉื mentions. ืœื›ืœ ืื•ื‘ื™ื™ืงื˜ ื‘ืจืฉื™ืžื” ื–ื• ื™ืฉ ืืช ื”ืžื‘ื ื” ื”ื‘ื.

ืื•ื‘ื™ื™ืงื˜ ืื–ื›ื•ืจื™ ืชื’ื•ื‘ื”
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. ืœื›ืœ ืื•ื‘ื™ื™ืงื˜ ื‘ืจืฉื™ืžื” ื–ื• ื™ืฉ ืืช ื”ืžื‘ื ื” ื”ื‘ื. ื ื™ืชืŸ ื’ื ืœื”ื•ืกื™ืฃ ื”ืืฉื˜ืื’ื™ื ื‘ืื•ืคืŸ ื™ื“ื ื™ ืœืžืขืจืš hashTags ืฉืœ ื”ืชื’ื•ื‘ื” ืœืฉืื™ืœืชื•ืช, ืื retain ืžื•ื’ื“ืจ.

ืื•ื‘ื™ื™ืงื˜ ื”ืืฉื˜ืื’ ืชื’ื•ื‘ื”
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

ืžื‘ื ื” ืชื‘ื ื™ืช ื“ื•ืืดืœ Internal Link

ืื•ื‘ื™ื™ืงื˜ EmailTemplate ืžื™ื™ืฆื’ ืงื•ื ืคื™ื’ื•ืจืฆื™ื” ืœืชื‘ื ื™ืช ืื™ืžื™ื™ืœ ืžื•ืชืืžืช ืื™ืฉื™ืช, ืขื‘ื•ืจ ืฉื•ื›ืจ.

ื”ืžืขืจื›ืช ืชื‘ื—ืจ ืืช ืชื‘ื ื™ืช ื”ืื™ืžื™ื™ืœ ืœืฉื™ืžื•ืฉ ื‘ืืžืฆืขื•ืช:

  • ืžื–ื”ื” ื”ืกื•ื’ ืฉืœื”, ืื ื—ื ื• ืงื•ืจืื™ื ืœื–ื” emailTemplateId. ืืœื” ืงื‘ื•ืขื™ื.
  • ื”-domain. ืื ื—ื ื• ืงื•ื“ื ื ื ืกื” ืœืžืฆื•ื ืชื‘ื ื™ืช ืขื‘ื•ืจ ื”ื“ื•ืžื™ื™ืŸ ืฉื”ืื•ื‘ื™ื™ืงื˜ ื”ืงืฉื•ืจ (ื›ืžื• Comment) ืงืฉื•ืจ ืืœื™ื•, ื•ืื ืœื ื ืžืฆืื” ื”ืชืืžื” ืื– ื ื ืกื” ืœืžืฆื•ื ืชื‘ื ื™ืช ืฉื‘ื” domain ื”ื•ื null ืื• *.

ื”ืžื‘ื ื” ืขื‘ื•ืจ ืื•ื‘ื™ื™ืงื˜ EmailTemplate ื”ื•ื ื›ื“ืœืงืžืŸ:

ืžื‘ื ื” ืชื‘ื ื™ืช ืื™ืžื™ื™ืœ
Copy Copy
1
2interface EmailTemplate {
3 id: string
4 tenantId: string
5 emailTemplateId: string
6 displayName: string
7 /** READONLY **/
8 createdAt: string
9 /** READONLY **/
10 updatedAt: string
11 /** READONLY **/
12 updatedByUserId: string
13 /** The domain the template should be associated with. **/
14 domain?: string | '*' | null
15 /** The email template content in EJS syntax. **/
16 ejs: string
17 /** A map of overridden translation keys to values, for each supported locale. **/
18 translationOverridesByLocale: Record<string, Record<string, string>>
19 /** An object that represents the render context of the template. **/
20 testData: object
21}
22

ื”ืขืจื•ืช

  • ืืชื” ื™ื›ื•ืœ ืœืงื‘ืœ ืืช ืขืจื›ื™ emailTemplateId ื”ื—ื•ืงื™ื™ื ืžื ืงื•ื“ืช ื”ืงืฆื” /definitions.
  • ื ืงื•ื“ืช ื”ืงืฆื” /definitions ื›ื•ืœืœืช ื’ื ืืช ื”ืชืจื’ื•ืžื™ื ื‘ืจื™ืจืช ื”ืžื—ื“ืœ ื•ื ืชื•ื ื™ ื”ื‘ื“ื™ืงื”.
  • ืชื‘ื ื™ื•ืช ื™ื™ื›ืฉืœื• ื‘ืฉืžื™ืจื” ืขื ืžื‘ื ื” ืื• ื ืชื•ื ื™ ื‘ื“ื™ืงื” ืœื ื—ื•ืงื™ื™ื.

ืžื‘ื ื” ืชื’ื™ืช Internal Link

ืื•ื‘ื™ื™ืงื˜ HashTag ืžื™ื™ืฆื’ ืชื’ื™ืช ืฉื™ื›ื•ืœื” ืœื”ื™ื•ืช ืžื•ืฉืืจืช ืขืœ ื™ื“ื™ ืžืฉืชืžืฉ. ื”ืืฉื˜ืื’ื™ื ื™ื›ื•ืœื™ื ืœืฉืžืฉ ืœืงื™ืฉื•ืจ ืœืชื•ื›ืŸ ื—ื™ืฆื•ื ื™ ืื• ืœืงืฉืจ ืชื’ื•ื‘ื•ืช ืงืฉื•ืจื•ืช ื™ื—ื“.

ื”ืžื‘ื ื” ืขื‘ื•ืจ ืื•ื‘ื™ื™ืงื˜ HashTag ื”ื•ื ื›ื“ืœืงืžืŸ:

ืžื‘ื ื” ื”ืืฉื˜ืื’
Copy Copy
1
2interface HashTag {
3 /** Should start with the "#" or desired character. **/
4 tag: string
5 /** An optional URL that the hashtag can point to. Instead of filtering comments by hashtag, the UI will redirect to this upon click. **/
6 url?: string
7 /** READONLY **/
8 createdAt: string
9}
10

ื”ืขืจื•ืช:

  • ื‘ื—ืœืง ืžื ืงื•ื“ื•ืช ื”ืงืฆื” ืฉืœ ื”-API ืชืจืื” ืฉื”ื”ืืฉื˜ืื’ ืžืฉืžืฉ ื‘-URL. ื–ื›ื•ืจ ืœืงื•ื“ื“ URI ืืช ื”ืขืจื›ื™ื. ืœื“ื•ื’ืžื”, # ืฆืจื™ืš ืœื”ื™ื•ืช ืžื™ื•ืฆื’ ื›-%23.
  • ื—ืœืง ืžื”ืฉื“ื•ืช ื”ืœืœื• ืžืกื•ืžื ื™ื ื›-READONLY - ืืœื” ืžื•ื—ื–ืจื™ื ืขืœ ื™ื“ื™ ื”-API ืื‘ืœ ืœื ื ื™ืชืŸ ืœื”ื’ื“ื™ืจ ืื•ืชื.

ืžื‘ื ื” ืกืคื™ืจืช ื”ืชืจืื•ืช Internal Link

ืื•ื‘ื™ื™ืงื˜ NotificationCount ืžื™ื™ืฆื’ ืืช ืกืคื™ืจืช ื”ื”ืชืจืื•ืช ืฉืœื ื ืงืจืื• ื•ืžื˜ื-ื ืชื•ื ื™ื ืขื‘ื•ืจ ืžืฉืชืžืฉ.

ืื ืื™ืŸ ื”ืชืจืื•ืช ืฉืœื ื ืงืจืื•, ืœื ื™ื”ื™ื” NotificationCount ืขื‘ื•ืจ ื”ืžืฉืชืžืฉ.

ืื•ื‘ื™ื™ืงื˜ื™ NotificationCount ื ื•ืฆืจื™ื ืื•ื˜ื•ืžื˜ื™ืช ื•ืœื ื ื™ืชืŸ ืœื™ืฆื•ืจ ืื•ืชื ื“ืจืš ื”-API. ื”ื ื’ื ืคื’ื™ื ืœืื—ืจ ืฉื ื” ืื—ืช.

ืืชื” ื™ื›ื•ืœ ืœื ืงื•ืช ืืช ืกืคื™ืจืช ื”ื”ืชืจืื•ืช ืฉืœื ื ืงืจืื• ืฉืœ ืžืฉืชืžืฉ ืขืœ ื™ื“ื™ ืžื—ื™ืงืช ื”-NotificationCount ืฉืœื•.

ื”ืžื‘ื ื” ืขื‘ื•ืจ ืื•ื‘ื™ื™ืงื˜ NotificationCount ื”ื•ื ื›ื“ืœืงืžืŸ:

ืžื‘ื ื” NotificationCount
Copy Copy
1
2interface NotificationCount {
3 id: string // user id
4 count: number
5 createdAt: string // date string
6 expireAt: string // date string
7}
8

ืžื‘ื ื” ื”ืชืจืื” Internal Link

ืื•ื‘ื™ื™ืงื˜ Notification ืžื™ื™ืฆื’ ื”ืชืจืื” ืขื‘ื•ืจ ืžืฉืชืžืฉ.

ืื•ื‘ื™ื™ืงื˜ื™ Notification ื ื•ืฆืจื™ื ืื•ื˜ื•ืžื˜ื™ืช ื•ืœื ื ื™ืชืŸ ืœื™ืฆื•ืจ ืื•ืชื ื“ืจืš ื”-API. ื”ื ื’ื ืคื’ื™ื ืœืื—ืจ ืฉื ื” ืื—ืช. ืœื ื ื™ืชืŸ ืœืžื—ื•ืง ื”ืชืจืื•ืช. ืขื ื–ืืช, ื ื™ืชืŸ ืœืขื“ื›ืŸ ืื•ืชืŸ ื›ื“ื™ ืœื”ื’ื“ื™ืจ ืืช viewed ืœ-false, ื•ื ื™ืชืŸ ืœื‘ืฆืข ืฉืื™ืœืชื” ืœืคื™ viewed.

ืžืฉืชืžืฉ ื™ื›ื•ืœ ื’ื ืœื‘ื—ื•ืจ ืœืฆืืช ืžื”ืชืจืื•ืช ืขื‘ื•ืจ ืชื’ื•ื‘ื” ืกืคืฆื™ืคื™ืช ืขืœ ื™ื“ื™ ื”ื’ื“ืจืช optedOut ื‘ื”ืชืจืื” ืœ-true. ื ื™ืชืŸ ืœื”ืฆื˜ืจืฃ ืžื—ื“ืฉ ืขืœ ื™ื“ื™ ื”ื’ื“ืจืชื• ืœ-false.

ื™ืฉื ื ืกื•ื’ื™ ื”ืชืจืื•ืช ืฉื•ื ื™ื - ื‘ื“ื•ืง ืืช relatedObjectType ื•-type.

ื”ื“ืจื›ื™ื ืœื™ืฆื™ืจืช ื”ืชืจืื•ืช ื”ืŸ ื“ื™ ื’ืžื™ืฉื•ืช ื•ื ื™ืชื ื•ืช ืœื”ืคืขืœื” ืขืœ ื™ื“ื™ ืชืจื—ื™ืฉื™ื ืจื‘ื™ื (ืจืื” NotificationType).

ื ื›ื•ืŸ ืœื”ื™ื•ื, ืงื™ื•ื Notification ืœื ื‘ืืžืช ืžืจืžื– ืฉืื™ืžื™ื™ืœ ื ืฉืœื— ืื• ืฆืจื™ืš ืœื”ื™ืฉืœื—. ื‘ืžืงื•ื ื–ืืช, ื”ื”ืชืจืื•ืช ืžืฉืžืฉื•ืช ืœืคื™ื“ ื”ื”ืชืจืื•ืช ื•ืื™ื ื˜ื’ืจืฆื™ื•ืช ืงืฉื•ืจื•ืช.

ื”ืžื‘ื ื” ืขื‘ื•ืจ ืื•ื‘ื™ื™ืงื˜ Notification ื”ื•ื ื›ื“ืœืงืžืŸ:

ืžื‘ื ื” ื”ืชืจืื”
Copy Copy
1
2enum NotificationObjectType {
3 Comment = 0,
4 Profile = 1,
5 Tenant = 2
6}
7
8enum NotificationType {
9 /** If someone replied to you. **/
10 RepliedToMe = 0,
11 /** If someone replied anywhere in a thread (even children of children) of a thread you commented on. **/
12 RepliedTransientChild = 1,
13 /** If your comment was up-voted. **/
14 VotedMyComment = 2,
15 /** If a new comment is left on the root of a page you're subscribed to. **/
16 SubscriptionReplyRoot = 3,
17 /** If someone commented on your profile. **/
18 CommentedOnProfile = 4,
19 /** If you have a DM. **/
20 DirectMessage = 5,
21 /** TrialLimits is for tenant users only. **/
22 TrialLimits = 6,
23 /** If you were @mentioned. **/
24 Mentioned = 7
25}
26
27interface Notification {
28 id: string
29 tenantId: string
30 /** With SSO, the user id is in the format `<tenant id>:<user id>`. **/
31 userId?: string
32 /** When working with SSO, you only have to worry about `userId`. **/
33 anonUserId?: string
34 /** urlId is almost always defined. It is only optional for tenant-level notifications, which are infrequent. **/
35 urlId?: string
36 /** URL is cached for quick navigation to the source of the notification. **/
37 url?: string
38 /** Page Title is cached for quick reading of notification source. **/
39 pageTitle?: string
40 relatedObjectType: NotificationObjectType
41 /** For example, comment id. **/
42 relatedObjectId: string
43 viewed: boolean
44 createdAt: string // date string
45 type: NotificationType
46 fromCommentId?: string
47 fromVoteId?: string
48 /** fromUserName and fromUserAvatarSrc are cached here for quick displaying of the notification. They are updated when the user is updated. **/
49 fromUserName: string
50 fromUserId: string
51 fromUserAvatarSrc?: string
52 /** Set this to true to stop getting notifications for this object. **/
53 optedOut?: boolean
54}
55

ืžื‘ื ื” ืขืžื•ื“ Internal Link

ืื•ื‘ื™ื™ืงื˜ Page ืžื™ื™ืฆื’ ืืช ื”ืขืžื•ื“ ืฉืชื’ื•ื‘ื•ืช ืจื‘ื•ืช ื™ื›ื•ืœื•ืช ืœื”ืฉืชื™ื™ืš ืืœื™ื•. ื™ื—ืก ื–ื” ืžื•ื’ื“ืจ ืขืœ ื™ื“ื™ urlId.

Page ืžืื—ืกืŸ ืžื™ื“ืข ื›ื’ื•ืŸ ื›ื•ืชืจืช ื”ืขืžื•ื“, ืžืกืคืจ ื”ืชื’ื•ื‘ื•ืช, ื•-urlId.

ื”ืžื‘ื ื” ืขื‘ื•ืจ ืื•ื‘ื™ื™ืงื˜ Page ื”ื•ื ื›ื“ืœืงืžืŸ:

ืžื‘ื ื” ืขืžื•ื“
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 /** Setting this to null means all SSO users can see the page. An empty list means it is closed to all users. **/
11 accessibleByGroupIds?: string[] | null
12 /** Is this page closed for new comments? **/
13 isClosed?: boolean
14}
15

ืžื‘ื ื” ืื™ืจื•ืข Webhook ืžืžืชื™ืŸ Internal Link

ืื•ื‘ื™ื™ืงื˜ PendingWebhookEvent ืžื™ื™ืฆื’ ืื™ืจื•ืข webhook ื‘ืชื•ืจ ืฉืžืžืชื™ืŸ.

ืื•ื‘ื™ื™ืงื˜ื™ PendingWebhookEvent ื ื•ืฆืจื™ื ืื•ื˜ื•ืžื˜ื™ืช ื•ืœื ื ื™ืชืŸ ืœื™ืฆื•ืจ ืื•ืชื ื™ื“ื ื™ืช ื“ืจืš ื”-API. ื”ื ื’ื ืคื’ื™ื ืœืื—ืจ ืฉื ื” ืื—ืช. ื ื™ืชืŸ ืœืžื—ื•ืง ืื•ืชื ืžื” ืฉืžืกื™ืจ ืืช ื”ืžืฉื™ืžื” ืžื”ืชื•ืจ.

ื™ืฉ ืกื•ื’ื™ ืื™ืจื•ืขื™ื ืฉื•ื ื™ื - ื‘ื“ื•ืง eventType (OutboundSyncEventType) ื•-type (OutboundSyncType).

ืžืงืจื” ืฉื™ืžื•ืฉ ื ืคื•ืฅ ืœ-API ื–ื” ื”ื•ื ืœื™ื™ืฉื ื ื™ื˜ื•ืจ ืžื•ืชืื ืื™ืฉื™ืช. ื™ื™ืชื›ืŸ ืฉืชืจืฆื” ืœืงืจื•ื ืœื ืงื•ื“ืช ื”ืงืฆื” /count ืžืขืช ืœืขืช ื›ื“ื™ ืœื‘ื“ื•ืง ืืช ื”ืกืคื™ืจื” ื”ืžืžืชื™ื ื” ืขื‘ื•ืจ ืžืกื ื ื™ื ื ืชื•ื ื™ื.

ื”ืžื‘ื ื” ืขื‘ื•ืจ ืื•ื‘ื™ื™ืงื˜ PendingWebhookEvent ื”ื•ื ื›ื“ืœืงืžืŸ:

ืžื‘ื ื” PendingWebhookEvent
Copy Copy
1
2enum OutboundSyncEventType {
3 Create: 0,
4 Delete: 1,
5 Update: 2
6}
7
8enum OutboundSyncType {
9 /** WordPress-specific sync task. **/
10 WP: 0,
11 Webhook: 1
12}
13
14interface PendingWebhookEvent {
15 id: string
16 /** The comment id associated with the event. **/
17 commentId: string
18 /** The comment object for the event at the time of the event. We started adding these in Nov 2023. **/
19 comment: Comment
20 /** An external id that may be associated with the comment. **/
21 externalId: string | null
22 createdAt: Date
23 tenantId: string
24 attemptCount: number
25 /** Set before first attempt, and after every failure. **/
26 nextAttemptAt: Date
27 /** Whether this is a creation, deletion, or update event... **/
28 eventType: OutboundSyncEventType
29 /** The type of sync to perform (WordPress, call API, etc). **/
30 type: OutboundSyncType
31 /** The domain that matched the comment. We use this domain to pick the API key. **/
32 domain: string
33 /** The last error that occurred. This type is untyped and is a "dump" of whatever happened. Usually it contains an object with statusCode, body, and a headers map. **/
34 lastError: object | null
35}
36

ืžื‘ื ื” ืžืฉืชืžืฉ SSO Internal Link

FastComments ืžืกืคืง ืคืชืจื•ืŸ SSO ืงืœ ืœืฉื™ืžื•ืฉ. ืขื“ื›ื•ืŸ ืžื™ื“ืข ืžืฉืชืžืฉ ืขื ืื™ื ื˜ื’ืจืฆื™ื” ืžื‘ื•ืกืกืช HMAC ื”ื•ื ืคืฉื•ื˜ ื›ืžื• ืœื’ืจื•ื ืœืžืฉืชืžืฉ ืœื˜ืขื•ืŸ ืืช ื”ืขืžื•ื“ ืขื ืžื˜ืขืŸ ืžืขื•ื“ื›ืŸ.

ืขื ื–ืืช, ื™ื™ืชื›ืŸ ืฉื™ื”ื™ื” ืจืฆื•ื™ ืœื ื”ืœ ืžืฉืชืžืฉ ืžื—ื•ืฅ ืœื–ืจื™ืžื” ื–ื•, ื›ื“ื™ ืœืฉืคืจ ืืช ืขืงื‘ื™ื•ืช ื”ืืคืœื™ืงืฆื™ื” ืฉืœืš.

ื”-API ืฉืœ ืžืฉืชืžืฉ SSO ืžืกืคืง ื“ืจืš ืœื‘ืฆืข ืคืขื•ืœื•ืช CRUD ืขืœ ืื•ื‘ื™ื™ืงื˜ื™ื ืฉืื ื—ื ื• ืงื•ืจืื™ื ืœื”ื SSOUsers. ืื•ื‘ื™ื™ืงื˜ื™ื ืืœื” ืฉื•ื ื™ื ืžืžืฉืชืžืฉื™ื ืจื’ื™ืœื™ื ื• ื ืฉืžืจื™ื ื‘ื ืคืจื“ ืœื‘ื˜ื™ื—ื•ืช ื˜ื™ืคื•ืกื™ื.

ื”ืžื‘ื ื” ืขื‘ื•ืจ ืื•ื‘ื™ื™ืงื˜ SSOUser ื”ื•ื ื›ื“ืœืงืžืŸ:

ืžื‘ื ื” SSOUser
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 // Admin permission - SSO users with this flag are billed as SSO Admins (separate from regular SSO users)
16 isAdminAdmin?: boolean // Admin permission - SSO users with this flag are billed as SSO Admins (separate from regular SSO users)
17 isCommentModeratorAdmin?: boolean // Moderator permission - SSO users with this flag are billed as SSO Moderators (separate from regular SSO users)
18 /** If null, Access Control will not be applied to the user. If an empty list, this user will not be able to see any pages or @mention other users. **/
19 groupIds?: string[] | null
20 createdFromSimpleSSO?: boolean
21 /** Don't let other users see this user's activity, including comments, on their profile. Default is true to provide secure profiles by default. **/
22 isProfileActivityPrivate?: boolean
23 /** Don't let other users leave comments on the user's profile, or see existing profile comments. Default false. **/
24 isProfileCommentsPrivate?: boolean
25 /** Don't let other users send direct messages to this user. Default false. **/
26 isProfileDMDisabled?: boolean
27 karma?: number
28 /** Optional configuration for user badges. **/
29 badgeConfig?: {
30 /** Array of badge IDs to assign to the user. Limited to 30 badges. Order is respected. **/
31 badgeIds: string[]
32 /** If true, replaces all existing displayed badges with the provided ones. If false, adds to existing badges. **/
33 override?: boolean
34 /** If true, updates badge display properties from tenant configuration. **/
35 update?: boolean
36 }
37}
38

ื—ื™ื•ื‘ ืขื‘ื•ืจ ืžืฉืชืžืฉื™ SSO

ืžืฉืชืžืฉื™ SSO ืžื—ื•ื™ื‘ื™ื ื‘ืฆื•ืจื” ืฉื•ื ื” ื‘ื”ืชื‘ืกืก ืขืœ ื“ื’ืœื™ ื”ื”ืจืฉืื•ืช ืฉืœื”ื:

  • ืžืฉืชืžืฉื™ SSO ืจื’ื™ืœื™ื: ืžืฉืชืžืฉื™ื ืœืœื ื”ืจืฉืื•ืช ืžื ื”ืœ ืื• ืžื ื”ืœ ืชื•ื›ืŸ ืžื—ื•ื™ื‘ื™ื ื›ืžืฉืชืžืฉื™ SSO ืจื’ื™ืœื™ื
  • ืžื ื”ืœื™ SSO: ืžืฉืชืžืฉื™ื ืขื ื“ื’ืœื™ isAccountOwner ืื• isAdminAdmin ืžื—ื•ื™ื‘ื™ื ื‘ื ืคืจื“ ื›ืžื ื”ืœื™ SSO (ืื•ืชื• ืชืขืจื™ืฃ ื›ืžื ื”ืœื™ ืฉื•ื›ืจ ืจื’ื™ืœื™ื)
  • ืžื ื”ืœื™ ืชื•ื›ืŸ SSO: ืžืฉืชืžืฉื™ื ืขื ื“ื’ืœ isCommentModeratorAdmin ืžื—ื•ื™ื‘ื™ื ื‘ื ืคืจื“ ื›ืžื ื”ืœื™ ืชื•ื›ืŸ SSO (ืื•ืชื• ืชืขืจื™ืฃ ื›ืžื ื”ืœื™ ืชื•ื›ืŸ ืจื’ื™ืœื™ื)

ื—ืฉื•ื‘: ื›ื“ื™ ืœืžื ื•ืข ื—ื™ื•ื‘ ื›ืคื•ืœ, ื”ืžืขืจื›ืช ืžืกื™ืจื” ืื•ื˜ื•ืžื˜ื™ืช ื›ืคื™ืœื•ื™ื•ืช ืฉืœ ืžืฉืชืžืฉื™ SSO ืžื•ืœ ืžืฉืชืžืฉื™ ืฉื•ื›ืจ ืจื’ื™ืœื™ื ื•ืžื ื”ืœื™ ืชื•ื›ืŸ ืœืคื™ ื›ืชื•ื‘ืช ืื™ืžื™ื™ืœ. ืื ืœืžืฉืชืžืฉ SSO ื™ืฉ ืืช ืื•ืชื• ืื™ืžื™ื™ืœ ื›ืžื• ืžืฉืชืžืฉ ืฉื•ื›ืจ ืจื’ื™ืœ ืื• ืžื ื”ืœ ืชื•ื›ืŸ, ื”ื•ื ืœื ื™ื—ื•ื™ื‘ ืคืขืžื™ื™ื.

ื‘ืงืจืช ื’ื™ืฉื”

ื ื™ืชืŸ ืœื—ืœืง ืžืฉืชืžืฉื™ื ืœืงื‘ื•ืฆื•ืช. ืœืฉื ื›ืš ืžืฉืžืฉ ืฉื“ื” groupIds, ื•ื”ื•ื ืื•ืคืฆื™ื•ื ืœื™.

@ืื–ื›ื•ืจื™ื

ื›ื‘ืจื™ืจืช ืžื—ื“ืœ @mentions ื™ืฉืชืžืฉ ื‘-username ื›ื“ื™ ืœื—ืคืฉ ืžืฉืชืžืฉื™ sso ืื—ืจื™ื ื›ืืฉืจ ืžืงืœื™ื“ื™ื ืืช ื”ืชื• @. ืื ืžืฉืชืžืฉื™ื ื‘-displayName, ืื– ืชื•ืฆืื•ืช ื”ืชื•ืืžื•ืช ืœ-username ื™ืชืขืœืžื• ื›ืฉื™ืฉ ื”ืชืืžื” ืœ-displayName, ื•ืชื•ืฆืื•ืช ื”ื—ื™ืคื•ืฉ ืฉืœ @mention ื™ืฉืชืžืฉื• ื‘-displayName.

ืžื ื•ื™ื™ื

ืขื FastComments, ืžืฉืชืžืฉื™ื ื™ื›ื•ืœื™ื ืœื”ื™ืจืฉื ืœืขืžื•ื“ ืขืœ ื™ื“ื™ ืœื—ื™ืฆื” ืขืœ ืกืžืœ ื”ืคืขืžื•ืŸ ื‘ื•ื•ื™ื“ื’'ื˜ ื”ืชื’ื•ื‘ื•ืช ื•ืœื—ื™ืฆื” ืขืœ ื”ื™ืจืฉื.

ืขื ืžืฉืชืžืฉ ืจื’ื™ืœ, ืื ื—ื ื• ืฉื•ืœื—ื™ื ืœื”ื ืื™ืžื™ื™ืœื™ ื”ืชืจืื•ืช ืขืœ ื‘ืกื™ืก ื”ื’ื“ืจื•ืช ื”ื”ืชืจืื•ืช ืฉืœื”ื.

ืขื ืžืฉืชืžืฉื™ SSO, ืื ื—ื ื• ืžืคืฆืœื™ื ื–ืืช ืœืชืื™ืžื•ืช ืœืื—ื•ืจ. ืžืฉืชืžืฉื™ื ื™ืงื‘ืœื• ืืช ืื™ืžื™ื™ืœื™ ื”ืชืจืื•ืช ื”ืžื ื•ื™ ื”ื ื•ืกืคื™ื ื”ืืœื” ืจืง ืื ืชื’ื“ื™ืจ optedInSubscriptionNotifications ืœ-true.

ืชื’ื™ื

ืืชื” ื™ื›ื•ืœ ืœื”ืงืฆื•ืช ืชื’ื™ื ืœืžืฉืชืžืฉื™ SSO ื‘ืืžืฆืขื•ืช ืžืืคื™ื™ืŸ badgeConfig. ืชื’ื™ื ื”ื ืื™ื ื“ื™ืงื˜ื•ืจื™ื ื—ื–ื•ืชื™ื™ื ืฉืžื•ืคื™ืขื™ื ืœื™ื“ ืฉื ื”ืžืฉืชืžืฉ ื‘ืชื’ื•ื‘ื•ืช.

  • badgeIds - ืžืขืจืš ืฉืœ ืžื–ื”ื™ ืชื’ื™ื ืœื”ืงืฆืื” ืœืžืฉืชืžืฉ. ืืœื” ื—ื™ื™ื‘ื™ื ืœื”ื™ื•ืช ืžื–ื”ื™ ืชื’ื™ื ื—ื•ืงื™ื™ื ืฉื ื•ืฆืจื• ื‘ื—ืฉื‘ื•ืŸ FastComments ืฉืœืš. ืžื•ื’ื‘ืœ ืœ-30 ืชื’ื™ื.
  • override - ืื true, ื›ืœ ื”ืชื’ื™ื ื”ืงื™ื™ืžื™ื ื”ืžื•ืฆื’ื™ื ื‘ืชื’ื•ื‘ื•ืช ื™ื•ื—ืœืคื• ื‘ืืœื” ืฉืกื•ืคืงื•. ืื false ืื• ืœื ืžืฆื•ื™ืŸ, ื”ืชื’ื™ื ืฉืกื•ืคืงื• ื™ืชื•ื•ืกืคื• ืœื›ืœ ืชื’ื™ื ืงื™ื™ืžื™ื.
  • update - ืื true, ืžืืคื™ื™ื ื™ ืชืฆื•ื’ืช ื”ืชื’ื™ื ื™ืขื•ื“ื›ื ื• ืžืงื•ื ืคื™ื’ื•ืจืฆื™ื™ืช ื”ืฉื•ื›ืจ ื‘ื›ืœ ืคืขื ืฉื”ืžืฉืชืžืฉ ืžืชื—ื‘ืจ.

ืžื‘ื ื” ืžื ื•ื™ Internal Link

ืื•ื‘ื™ื™ืงื˜ Subscription ืžื™ื™ืฆื’ ืžื ื•ื™ ืขื‘ื•ืจ ืžืฉืชืžืฉ.

ืื•ื‘ื™ื™ืงื˜ื™ Subscription ื ื•ืฆืจื™ื ื›ืืฉืจ ืžืฉืชืžืฉ ืœื•ื—ืฅ ืขืœ ืคืขืžื•ืŸ ื”ื”ืชืจืื•ืช ื‘ื•ื•ื™ื“ื’'ื˜ ื”ืชื’ื•ื‘ื•ืช ื•ืœื•ื—ืฅ ืขืœ "ื”ื™ืจืฉื ืœืขืžื•ื“ ื–ื”".

ื ื™ืชืŸ ื’ื ืœื™ืฆื•ืจ ืžื ื•ื™ื™ื ื“ืจืš ื”-API.

ืงื™ื•ื ืื•ื‘ื™ื™ืงื˜ Subscription ื’ื•ืจื ืœื™ืฆื™ืจืช ืื•ื‘ื™ื™ืงื˜ื™ Notification, ื•ืฉืœื™ื—ืช ืื™ืžื™ื™ืœื™ื, ื›ืืฉืจ ืชื’ื•ื‘ื•ืช ื—ื“ืฉื•ืช ื ืฉืืจื•ืช ื‘ืฉื•ืจืฉ ื”ืขืžื•ื“ ื”ืžืฉื•ื™ืš ืฉื”-Subscription ื”ื•ื ืขื‘ื•ืจื•. ืฉืœื™ื—ืช ืื™ืžื™ื™ืœื™ื ืชืœื•ื™ื” ื‘ืกื•ื’ ื”ืžืฉืชืžืฉ. ืœืžืฉืชืžืฉื™ื ืจื’ื™ืœื™ื ื–ื” ืชืœื•ื™ ื‘-optedInNotifications. ืœืžืฉืชืžืฉื™ SSO ื–ื” ืชืœื•ื™ ื‘-optedInSubscriptionNotifications. ืฉื™ื ืœื‘ ืฉืœื—ืœืง ืžื”ืืคืœื™ืงืฆื™ื•ืช ืื•ืœื™ ืื™ืŸ ืืช ื”ืจืขื™ื•ืŸ ืฉืœ ืขืžื•ื“ ื ื’ื™ืฉ ืœืื™ื ื˜ืจื ื˜, ื‘ืžืงืจื” ื–ื” ืคืฉื•ื˜ ื”ื’ื“ืจ ืืช urlId ืœ- ืžื–ื”ื” ื”ืคืจื™ื˜ ืฉืืชื” ื ืจืฉื ืืœื™ื• (ืื•ืชื• ืขืจืš ืขื‘ื•ืจ urlId ืฉื”ื™ื™ืช ืžืขื‘ื™ืจ ืœื•ื•ื™ื“ื’'ื˜ ื”ืชื’ื•ื‘ื•ืช).

ื”ืžื‘ื ื” ืขื‘ื•ืจ ืื•ื‘ื™ื™ืงื˜ Subscription ื”ื•ื ื›ื“ืœืงืžืŸ:

ืžื‘ื ื” ืžื ื•ื™
Copy Copy
1
2interface Subscription {
3 id: string
4 tenantId: string
5 /** With SSO, the user id is in the format `<tenant id>:<user id>`. **/
6 userId: string
7 anonUserId?: string
8 urlId: string
9 url?: string
10 pageTitle?: string
11 createdAt: string // date string
12}
13

ืžื‘ื ื” ืฉื™ืžื•ืฉ ื™ื•ืžื™ ืฉืœ ืฉื•ื›ืจ Internal Link

ืื•ื‘ื™ื™ืงื˜ TenantDailyUsage ืžื™ื™ืฆื’ ืืช ื”ืฉื™ืžื•ืฉ ืฉืœ ืฉื•ื›ืจ ื‘ื™ื•ื ื ืชื•ืŸ. ืื ืœื ื”ื™ื™ืชื” ืคืขื™ืœื•ืช ืœืฉื•ื›ืจ ื ืชื•ืŸ ื‘ื™ื•ื ื ืชื•ืŸ, ืื•ืชื• ื™ื•ื ืœื ื™ื”ื™ื” ืœื• ืื•ื‘ื™ื™ืงื˜ TenantDailyUsage.

ืื•ื‘ื™ื™ืงื˜ TenantDailyUsage ืื™ื ื• ื‘ื–ืžืŸ ืืžืช ื•ืขืฉื•ื™ ืœื”ื™ื•ืช ืžืกืคืจ ื“ืงื•ืช ืžืื—ื•ืจื™ ื”ืฉื™ืžื•ืฉ ื‘ืคื•ืขืœ.

ื”ืžื‘ื ื” ืขื‘ื•ืจ ืื•ื‘ื™ื™ืงื˜ TenantDailyUsage ื”ื•ื ื›ื“ืœืงืžืŸ:

ืžื‘ื ื” TenantDailyUsage
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 /** Ignored for billing. **/
19 ignored: boolean
20}
21

ืžื‘ื ื” ืฉื•ื›ืจ Internal Link

Tenant ืžื’ื“ื™ืจ ืœืงื•ื— ืฉืœ FastComments.com. ื ื™ืชืŸ ืœื™ืฆื•ืจ ืื•ืชื ื“ืจืš ื”-API ืขืœ ื™ื“ื™ ืฉื•ื›ืจื™ื ืขื ื’ื™ืฉืช white labeling. ืฉื•ื›ืจื™ white labeled ืœื ื™ื›ื•ืœื™ื ืœื™ืฆื•ืจ ืฉื•ื›ืจื™ white labeled ืื—ืจื™ื (ืจืง ืจืžื” ืื—ืช ืฉืœ ืงื™ื ื•ืŸ ืžื•ืชืจืช).

ื”ืžื‘ื ื” ืขื‘ื•ืจ ืื•ื‘ื™ื™ืงื˜ Tenant ื”ื•ื ื›ื“ืœืงืžืŸ:

ืžื‘ื ื” ืฉื•ื›ืจ
Copy Copy
1
2export enum SiteType {
3 Unknown = 0,
4 WordPress = 1
5}
6
7/** This can also be handled via the DomainConfig API. **/
8export interface TenantDomainConfig {
9 domain: string
10 emailFromName?: string
11 emailFromEmail?: string
12 createdAt?: string,
13 siteType?: FastCommentsSiteType, // you probably want Unknown
14 logoSrc?: string, // raw image path
15 logoSrc100px?: string, // resized for thumbnails
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; // number due to "legacy" reasons
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 - Is calculated based on packageId. **/
65 hasFlexPricing?: boolean
66 /** @readonly **/
67 flexLastBilledAmount?: number
68 /** @readonly - Is calculated based on packageId. **/
69 hasAuditing?: boolean
70 /** You can store a key value pair with the tenant which you can use to query. Keys cannot contain "." or "$", or be longer than 100 chars. Values may not be longer than 2k chars. **/
71 meta?: Record<string, string | null>
72}
73

ืžื‘ื ื” ืžืฉืชืžืฉ Internal Link

User ื”ื•ื ืื•ื‘ื™ื™ืงื˜ ื”ืžื™ื™ืฆื’ ืžื›ื ื” ืžืฉื•ืชืฃ ืฉืœ ื›ืœ ื”ืžืฉืชืžืฉื™ื.

ื–ื›ื•ืจ ืฉื‘-FastComments ื™ืฉ ืœื ื• ืžืกืคืจ ืžืงืจื™ ืฉื™ืžื•ืฉ ืฉื•ื ื™ื ืœืžืฉืชืžืฉื™ื:

  • SSO ืžืื•ื‘ื˜ื—
  • SSO ืคืฉื•ื˜
  • ืžืฉืชืžืฉื™ ืฉื•ื›ืจ (ืœื“ื•ื’ืžื”: ืžื ื”ืœื™ื)
  • ืžื’ื™ื‘ื™ื

API ื–ื” ืžื™ื•ืขื“ ืœืžื’ื™ื‘ื™ื ื•ืœืžืฉืชืžืฉื™ื ืฉื ื•ืฆืจื• ื“ืจืš SSO ืคืฉื•ื˜. ื‘ืขืฆื, ื›ืœ ืžืฉืชืžืฉ ืฉื ื•ืฆืจ ื“ืจืš ื”ืืชืจ ืฉืœืš ื ื™ืชืŸ ืœื’ื™ืฉื” ื“ืจืš API ื–ื”. ื ื™ืชืŸ ืœืื—ื–ืจ ื’ื ืžืฉืชืžืฉื™ ืฉื•ื›ืจ ื‘ื“ืจืš ื–ื•, ืืš ืชืงื‘ืœ ืžื™ื“ืข ื ื•ืกืฃ ืขืœ ื™ื“ื™ ืื™ื ื˜ืจืืงืฆื™ื” ืขื ื”-API /tenant-users/.

ืขื‘ื•ืจ SSO ืžืื•ื‘ื˜ื— ืื ื ื”ืฉืชืžืฉ ื‘-API /sso-users/.

ืœื ื ื™ืชืŸ ืœืขื“ื›ืŸ ืกื•ื’ื™ื ืืœื” ืฉืœ ืžืฉืชืžืฉื™ื. ื”ื ื™ืฆืจื• ืืช ื”ื—ืฉื‘ื•ืŸ ืฉืœื”ื ื“ืจืš ื”ืืชืจ ืฉืœืš, ืื– ืื ื• ืžืกืคืงื™ื ื’ื™ืฉื” ื‘ืกื™ืกื™ืช ืœืงืจื™ืื” ื‘ืœื‘ื“, ืื‘ืœ ืœื ื ื™ืชืŸ ืœื‘ืฆืข ืฉื™ื ื•ื™ื™ื. ืื ืืชื” ืจื•ืฆื” ืœืงื‘ืœ ื–ืจื™ืžื” ื›ื–ื• - ืืชื” ืฆืจื™ืš ืœื”ื’ื“ื™ืจ SSO ืžืื•ื‘ื˜ื—.

ื”ืžื‘ื ื” ืขื‘ื•ืจ ืื•ื‘ื™ื™ืงื˜ User ื”ื•ื ื›ื“ืœืงืžืŸ:

ืžื‘ื ื” User
Copy Copy
1
2export interface User {
3 /** This is also the id used as userId on comment objects. **/
4 id: string
5 username: string
6 /** A link to the commenter's blog, for example. **/
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

ืžื‘ื ื” ื”ืฆื‘ืขื” Internal Link

ืื•ื‘ื™ื™ืงื˜ Vote ืžื™ื™ืฆื’ ื”ืฆื‘ืขื” ืฉื”ื•ืฉืืจื” ืขืœ ื™ื“ื™ ืžืฉืชืžืฉ.

ื”ื™ื—ืก ื‘ื™ืŸ ืชื’ื•ื‘ื•ืช ืœื”ืฆื‘ืขื” ืžื•ื’ื“ืจ ื‘ืืžืฆืขื•ืช commentId.

ื”ืžื‘ื ื” ืขื‘ื•ืจ ืื•ื‘ื™ื™ืงื˜ Vote ื”ื•ื ื›ื“ืœืงืžืŸ:

ืžื‘ื ื” ื”ืฆื‘ืขื”
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

ืžื‘ื ื” ื”ื’ื“ืจื•ืช ืฉืืœื” Internal Link

FastComments ืžืกืคืง ื“ืจืš ืœื‘ื ื•ืช ืฉืืœื•ืช ื•ืœืื’ื•ืจ ืืช ืชื•ืฆืื•ืชื™ื”ืŸ. ื“ื•ื’ืžื” ืœืฉืืœื” (ืœื”ืœืŸ ื ืงืจืืช QuestionConfig) ื™ื›ื•ืœื” ืœื”ื™ื•ืช ื“ื™ืจื•ื’ ื›ื•ื›ื‘ื™ื, ืžื—ื•ื•ืŸ, ืื• ืฉืืœืช NPS (ื ืงื‘ืข ื‘ืืžืฆืขื•ืช type).

ื ื™ืชืŸ ืœืื’ื•ืจ ื ืชื•ื ื™ ืฉืืœื•ืช ื‘ื ืคืจื“, ื™ื—ื“, ืœืื•ืจืš ื–ืžืŸ, ื‘ืื•ืคืŸ ื›ื•ืœืœ, ืœืคื™ ืขืžื•ื“, ื•ื›ืŸ ื”ืœืื”.

ืœืžืกื’ืจืช ื™ืฉ ืืช ื›ืœ ื”ื™ื›ื•ืœื•ืช ื”ื ื“ืจืฉื•ืช ืœื‘ื ื™ื™ืช ื•ื•ื™ื“ื’'ื˜ื™ื ื‘ืฆื“ ื”ืœืงื•ื— (ืขื ื”ืฉืจืช ืฉืœืš ืžื•ืœ API ื–ื”), ื“ืฉื‘ื•ืจื“ื™ื ืœืžื ื”ืœื™ื, ื•ื›ืœื™ ื“ื™ื•ื•ื—.

ืจืืฉื™ืช, ืขืœื™ื ื• ืœื”ื’ื“ื™ืจ QuestionConfig. ื”ืžื‘ื ื” ื”ื•ื ื›ื“ืœืงืžืŸ:

ืžื‘ื ื” QuestionConfig
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 /** READONLY - incremented for each new response. **/
13 usedCount: number
14 /** A date string for when the configuration was last used (result left). **/
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

ืžื‘ื ื” ืชื•ืฆืืช ืฉืืœื” Internal Link

ื›ื“ื™ ืœืฉืžื•ืจ ืชื•ืฆืื•ืช ืœืฉืืœื•ืช, ืืชื” ื™ื•ืฆืจ QuestionResult. ืœืื—ืจ ืžื›ืŸ ืชื•ื›ืœ ืœืื’ื•ืจ ืชื•ืฆืื•ืช ืฉืืœื•ืช, ื•ื’ื ืœืงืฉืจ ืื•ืชืŸ ืœืชื’ื•ื‘ื•ืช ืœืžื˜ืจื•ืช ื“ื™ื•ื•ื—.

ืžื‘ื ื” QuestionResult
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

ืžื‘ื ื” ืชื’ ืžืฉืชืžืฉ Internal Link

UserBadge ื”ื•ื ืื•ื‘ื™ื™ืงื˜ ืฉืžื™ื™ืฆื’ ืชื’ ืฉื”ื•ืงืฆื” ืœืžืฉืชืžืฉ ื‘ืžืขืจื›ืช FastComments.

ื ื™ืชืŸ ืœื”ืงืฆื•ืช ืชื’ื™ื ืœืžืฉืชืžืฉื™ื ืื•ื˜ื•ืžื˜ื™ืช ืขืœ ื‘ืกื™ืก ื”ืคืขื™ืœื•ืช ืฉืœื”ื (ื›ื’ื•ืŸ ืžืกืคืจ ืชื’ื•ื‘ื•ืช, ื–ืžืŸ ืชื’ื•ื‘ื”, ืžืขืžื“ ื•ืชื™ืง) ืื• ื™ื“ื ื™ืช ืขืœ ื™ื“ื™ ืžื ื”ืœื™ ื”ืืชืจ.

ื”ืžื‘ื ื” ืขื‘ื•ืจ ืื•ื‘ื™ื™ืงื˜ UserBadge ื”ื•ื ื›ื“ืœืงืžืŸ:

ืžื‘ื ื” UserBadge
Copy Copy
1
2export interface UserBadge {
3 /** Unique identifier for this user badge assignment */
4 id: string
5 /** ID of the user this badge is assigned to */
6 userId: string
7 /** ID of the badge definition from the tenant's badge catalog */
8 badgeId: string
9 /** ID of the tenant that created/assigned this badge */
10 fromTenantId: string
11 /** When this badge was created (milliseconds since epoch) */
12 createdAt?: number
13 /** When this badge was received by the user (milliseconds since epoch) */
14 receivedAt?: number
15 /**
16 * The badge type:
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 /** For threshold-based badges, the threshold value */
25 threshold?: number
26 /** The name/label of the badge */
27 name?: string
28 /** Detailed description of the badge */
29 description?: string
30 /** The text shown on the badge */
31 displayLabel?: string
32 /** URL to an image shown on the badge */
33 displaySrc?: string
34 /** Background color for the badge (hex code) */
35 backgroundColor?: string
36 /** Border color for the badge (hex code) */
37 borderColor?: string
38 /** Text color for the badge (hex code) */
39 textColor?: string
40 /** Additional CSS class for styling */
41 cssClass?: string
42 /** For veteran badges, the time threshold in milliseconds */
43 veteranUserThresholdMillis?: number
44 /** Whether this badge is displayed on the user's comments */
45 displayedOnComments: boolean
46 /** The display order of the badge */
47 order?: number
48}
49

ืžื‘ื ื” ื”ืชืงื“ืžื•ืช ืชื’ื™ ืžืฉืชืžืฉ Internal Link

UserBadgeProgress ื”ื•ื ืื•ื‘ื™ื™ืงื˜ ื”ืžื™ื™ืฆื’ ืืช ื”ื”ืชืงื“ืžื•ืช ืฉืœ ืžืฉืชืžืฉ ืœืงืจืืช ืงื‘ืœืช ืชื’ื™ื ืฉื•ื ื™ื ื‘ืžืขืจื›ืช FastComments.

ืžืขืงื‘ ื–ื” ืขื•ื–ืจ ืœืงื‘ื•ืข ืžืชื™ ืžืฉืชืžืฉื™ื ืฆืจื™ื›ื™ื ืœืงื‘ืœ ืชื’ื™ื ืื•ื˜ื•ืžื˜ื™ื™ื ื‘ื”ืชื‘ืกืก ืขืœ ื”ืคืขื™ืœื•ืช ื•ื”ื”ืฉืชืชืคื•ืช ืฉืœื”ื ื‘ืงื”ื™ืœื” ืฉืœืš.

ื”ืžื‘ื ื” ืขื‘ื•ืจ ืื•ื‘ื™ื™ืงื˜ UserBadgeProgress ื”ื•ื ื›ื“ืœืงืžืŸ:

ืžื‘ื ื” UserBadgeProgress
Copy Copy
1
2export interface UserBadgeProgress {
3 /** Unique identifier for this progress record */
4 id: string
5 /** ID of the tenant this progress record belongs to */
6 tenantId: string
7 /** ID of the user this progress record tracks */
8 userId: string
9 /** ID of the user's first comment in the system */
10 firstCommentId?: string
11 /** Date of the user's first comment (milliseconds since epoch) */
12 firstCommentDate?: number
13 /** Automatically calculated trust factor based on user activity */
14 autoTrustFactor?: number
15 /** Manually set trust factor by administrators */
16 manualTrustFactor?: number
17 /** Detailed progress object with various metrics, keys match BadgeType enum */
18 progress: {
19 /** 0: CommentCount - Count of comments the user has made */
20 '0'?: number
21 /** 1: CommentUpVotes - Count of upvotes the user has received */
22 '1'?: number
23 /** 2: CommentReplies - Count of replies the user has made */
24 '2'?: number
25 /** 3: CommentsPinned - Count of pinned comments the user has */
26 '3'?: number
27 /** 4: Veteran - User's account age */
28 '4'?: number
29 /** 5: NightOwl - Times user has posted during nighttime hours */
30 '5'?: number
31 /** 6: FastReplyTime - Average reply time in milliseconds */
32 '6'?: number
33 /** 7: ModeratorCommentsDeleted - For moderator badges, comments deleted count */
34 '7'?: number
35 /** 8: ModeratorCommentsApproved - For moderator badges, comments approved count */
36 '8'?: number
37 /** 9: ModeratorCommentsUnapproved - For moderator badges, comments unapproved count */
38 '9'?: number
39 /** 10: ModeratorCommentsReviewed - For moderator badges, comments reviewed count */
40 '10'?: number
41 /** 11: ModeratorCommentsMarkedSpam - For moderator badges, comments marked as spam count */
42 '11'?: number
43 /** 12: ModeratorCommentsMarkedNotSpam - For moderator badges, comments marked as not spam count */
44 '12'?: number
45 /** 13: RepliedToSpecificPage - For each page, count of replies */
46 '13'?: Record<string, number>
47 }
48}
49

ืœืกื™ื›ื•ื

ืื ื• ืžืงื•ื•ื™ื ืฉืžืฆืืชื ืืช ืชื™ืขื•ื“ ื”-API ืฉืœื ื• ืžืงื™ืฃ ื•ืงืœ ืœื”ื‘ื ื”. ืื ืžืฆืืชื ืคืขืจื™ื, ืื ื ืขื“ื›ื ื• ืื•ืชื ื• ืœืžื˜ื”.