REST API
SlickComment API allows you to access/update all the data from/to the comment widgets on your site.
#
AuthenticationTo fully access and update your data, you need to send the API Key in each request as header x-api-key
or query parameter apiKey
.
You can get your API Key in the Console 🠦 Site 🠦 Api Key.
#
Comments#
Comment Structureinterface Comment { id: string, page: Page, parent: Comment|null, // parent comment won't have field `parent` rawContent: string, user: User|null, userEmail: string|null, userAvatarUrl: string|null, userProfileUrl: string|null, userRole: { code: 'ROLE_GUEST' | 'ROLE_MEMBER' | 'ROLE_MODERATOR' | 'ROLE_ADMIN', name: string, labelText: string, } isPinned: boolean, reactionCounts: { upvote: number, downvote: number, }, nbPublishedReplies: number, nbFlags: number, nbUnreadFlags: number, containsLink: boolean, containsMedia: boolean, containsRestrictedWords: boolean, moderationStatus: 'pending' | 'approved' | 'trashed' | null, url: string, directUrl: string, createdAt: string, createdAtCursor: string, // a unique string based on `createdAt`, helpful in pagination operations deletedByUserAt: string|null, lastRevisionAt: string|null, ipAddress: string|null, userAgent: string|null, isDeleted: boolean, // `true` when `deletedByUserAt` is not `null` isHidden: boolean, // `true` when `moderationStatus` is `pending` or `trashed`}
#
Get Collection[GET] https://api.slickcomment.com/api/sites/{siteId}/comments
#
Available query parametersKey | Possible values | Description |
---|---|---|
order[id] | DESC , ASC | Sort the collection by field id |
order[createdAtCursor] | DESC , ASC | Sort the collection by field createdAtCursor |
exist[user] | 0 , 1 | Filter comments posted by guests or users |
exist[deletedByUserAt] | 0 , 1 | Filter deleted comments (0 is not deleted, 1 is deleted) |
user.ssoId | User SSO Id | Filter comments posted by a user |
page.originalId | Page Original Id | Filter comments in a page, the original ID is the page ID that you passed us. |
moderationStatus | pending , approved , trashed | Filter comments by moderation status |
isPublished | 0 , 1 | Filter published comments (comments that are approved or have published replies) |
#
Users#
User Structureinterface User { id: number, ssoId: string|null, name: string, email: string|null, avatarUrl: string|null, profileUrl: string|null, role: { code: 'ROLE_GUEST' | 'ROLE_MEMBER' | 'ROLE_MODERATOR' | 'ROLE_ADMIN', name: string, isTrusted: boolean, canBeBanned: boolean, }, nbComments: number, nbPublishedComments: number, nbReactionsCreated: number, nbReactionsReceived: number, nbFlagsCreated: number, nbFlagsReceived: number, isTrusted: boolean, currentBan: CurrentBan|null,}
#
Get Collection[GET] https://api.slickcomment.com/api/sites/{siteId}/users
#
Available query parametersKey | Possible values | Description |
---|---|---|
order[id] | DESC , ASC | Sort the collection by field id |
order[nbPublishedComments] | DESC , ASC | Sort the collection by field nbPublishedComments |
ssoId | SSO ID of the user | Search a user by their ssoId |
name | Search users by name | |
email | Search users by email | |
isTrusted | 0 , 1 | Search trusted/untrusted users |
role.code | ROLE_MEMBER , ROLE_MODERATOR , ROLE_ADMIN | Search users by role |
exists[ssoId] | 0 , 1 | Filter users with/without ssoID |
exists[currentBan] | 0 , 1 | Filter users banned/unbanned users |
#
Update single User[POST] https://api.slickcomment.com/api/user_updates
#
Requestinterface UserUpdateRequest { userSsoId: string|null, // * Required newName: string|null, newEmail: string|null, newProfileUrl: string|null, newAvatarUrl: string|null, newSsoId: string|null, newRoleCode: string|null, newIsTrusted: string|null,}
#
Responseinterface UserUpdateResponse { user: User, // updated user userSsoId: string|null, newName: string|null, newEmail: string|null, newProfileUrl: string|null, newAvatarUrl: string|null, newSsoId: string|null, newRoleCode: string|null, newIsTrusted: string|null,}
#
Pages#
Page Structureinterface Page { id: number, originalId: string, title: string, url: string, nbComments: number, nbPublishedComments: number, nbRootComments: number, nbPublishedRootComments: number, isClosed: boolean, createdAt: string, updatedAt: string,}
#
Get Collection[GET] https://api.slickcomment.com/api/sites/{siteId}/pages
#
Available query parametersKey | Possible values | Description |
---|---|---|
order[id] | DESC , ASC | Sort the collection by field id |
order[nbPublishedComments] | DESC , ASC | Sort the collection by field nbPublishedComments |
order[createdAt] | DESC , ASC | Sort the collection by field createdAt |
order[updatedAt] | DESC , ASC | Sort the collection by field updatedAt |
isClosed | 0 , 1 | Filter closed pages |
originalId | Search a page by originalId | |
title | Search pages by title |
#
Update single Page[POST] https://api.slickcomment.com/api/page_updates
#
Requestinterface PageUpdateRequest { pageOriginalId: string, // * Required newOriginalId: string|null, newUrl: string|null, newTitle: string|null, newIsClosed: boolean|null,}
#
Responseinterface PageUpdateResponse { page: Page, // updated Page pageOriginalId: string, newOriginalId: string|null, newUrl: string|null, newTitle: string|null, newIsClosed: boolean|null,}