Skip to main content

REST API

SlickComment API allows you to access/update all the data from/to the comment widgets on your site.

Authentication#

To 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 Structure#

interface 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 parameters#

KeyPossible valuesDescription
order[id]DESC, ASCSort the collection by field id
order[createdAtCursor]DESC, ASCSort the collection by field createdAtCursor
exist[user]0, 1Filter comments posted by guests or users
exist[deletedByUserAt]0, 1Filter deleted comments (0 is not deleted, 1 is deleted)
user.ssoIdUser SSO IdFilter comments posted by a user
page.originalIdPage Original IdFilter comments in a page, the original ID is the page ID that you passed us.
moderationStatuspending, approved, trashedFilter comments by moderation status
isPublished0, 1Filter published comments (comments that are approved or have published replies)

Users#

User Structure#

interface 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 parameters#

KeyPossible valuesDescription
order[id]DESC, ASCSort the collection by field id
order[nbPublishedComments]DESC, ASCSort the collection by field nbPublishedComments
ssoIdSSO ID of the userSearch a user by their ssoId
nameSearch users by name
emailSearch users by email
isTrusted0, 1Search trusted/untrusted users
role.codeROLE_MEMBER, ROLE_MODERATOR, ROLE_ADMINSearch users by role
exists[ssoId]0, 1Filter users with/without ssoID
exists[currentBan]0, 1Filter users banned/unbanned users

Update single User#

[POST] https://api.slickcomment.com/api/user_updates

Request#

interface 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,}

Response#

interface 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 Structure#

interface 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 parameters#

KeyPossible valuesDescription
order[id]DESC, ASCSort the collection by field id
order[nbPublishedComments]DESC, ASCSort the collection by field nbPublishedComments
order[createdAt]DESC, ASCSort the collection by field createdAt
order[updatedAt]DESC, ASCSort the collection by field updatedAt
isClosed0, 1Filter closed pages
originalIdSearch a page by originalId
titleSearch pages by title

Update single Page#

[POST] https://api.slickcomment.com/api/page_updates

Request#

interface PageUpdateRequest {    pageOriginalId: string, // * Required        newOriginalId: string|null,    newUrl: string|null,    newTitle: string|null,    newIsClosed: boolean|null,}

Response#

interface PageUpdateResponse {    page: Page, // updated Page    pageOriginalId: string,    newOriginalId: string|null,    newUrl: string|null,    newTitle: string|null,    newIsClosed: boolean|null,}

Comments