Discourse

Discourse is a powerful open-source forum software.

Data integration: Skyvia supports importing data to and from Discourse, exporting Discourse data to CSV files, replicating Discourse data to relational databases, and synchronizing Discourse data with other cloud apps and relational databases.

Backup: Skyvia Backup does not support Discourse.

Query: Skyvia Query supports Discourse.

Establishing Connection

To establish a connection to Discourse, you must provide the Host URL, API Key, and User Name.

Getting Credentials

Host URL — Login to Discourse and copy the URL value of the Discourse. Note that it must include the protocol part (‘https://’), and must not include the slash (/) at the end. For example: https://mycorp.discourse.group

User Name — the name of the user you log in to Discourse with. You can get it on the User tab of the Admin panel.

API Key — To get the API Key, perform the following steps:

  1. Sign in to Discourse
  2. Click the button with three strips, then select Admin, and switch to the API tab.
  3. Click +New API Key.
  4. Specify the Description, the User level, and Scope. We recommend selecting the most comprehensive possible scopes.

    API Key creation in Discourse

  5. Click Save.
  6. Copy the displayed Key. Note that this is the only time it is displayed. If you ever need an API key again, you will need to create a new one.

    API Key

Creating Connection

Discourse connection editor

Copy the obtained credentials to the corresponding boxes in the Skyvia connection editor.

Connector Specifics

Object peculiarities

The DELETE operation against the Posts and LatestTopics tables performs soft delete. The deleted records remain in the table with the filled DeletedAt value. When selecting all records from these tables, the records with not empty DeletedAt value are not displayed. When selecting specific records by their ids, the deleted records are displayed.

Incremental Replication and Synchronization

Replication with Incremental Updates is supported for the following objects: Backups, Notifications, Posts, RepliestToPost, LatestTopics, ActiveUsers, UserActions. Note that only newly created objects are detected of the Notifications, LatestTopics, UserActions, and ActiveUsers objects because they have only the CreatedDate field, and don’t have the UpdatedDate field.

Only the Posts object supports synchronization.

DML Operations support

Operation Object
INSERT, UPDATE, DELETE Badges, Groups, LatestTopics, Posts
INSERT, DELETE ActiveUsers
INSERT, UPDATE Categories, TagGroups
INSERT PrivateMessagesSentForUser

Stored procedures

Skyvia represents part of the supported Discourse features as stored procedures. You can call a stored procedure, for example, as a text of the command in the ExecuteCommand action in a Target component of a Data Flow or in Query.

SuspendUser

To suspend the user activity, use the command

call SuspendUser(:UserId,:SuspendUntil,:Reason,:Message,:PostAction)

After executing command, the suspended users records are stored in the ActiveUsers and the SuspendedUsers objects.

PARAMETER NAME DESCRIPTION
UserId The Id of the user whose activity has to be suspended
SuspendUntil The date the user is suspended until
Reason The explanation why the user is suspended
Message The message to send to the suspended user
PostAction String

For example, call SuspendUser(7,'2022-12-15','some reason','some message','delete')

SilenceUser

To change use status to Silence, use the following command

call SilenceUser(:UserId,:SilencedTill,:Reason,:Message,:PostAction)

PARAMETER NAME DESCRIPTION
UserId The Id of the user whose activity has to be silenced
SilencedTill The date the user is silenced til
Reason The explanation for the action
Message The message to send to the silenced user
PostAction String

AnonymizeUser

To change user status to Anonim, use the command

call AnonymizeUser(:UserId)

UpdateUsername

To update the user name, use the command

call UpdateUsername(:Username,:NewUsername) updates the Username value.

PARAMETER NAME DESCRIPTION
Username Current Username value
NewUsername New Username value

AddGroupMembers

To add the user to the specific group, use the command

call AddGroupMembers(:groupId,:username)

RemoveGroupMembers

To remove the user from the specific group, use the command

call RemoveGroupMembers(:groupId,:username)

MarkNotificationsAsRead

To mark the existing notification as read, use the command

call MarkNotificationsAsRead(:NotificationId)

Supported Actions

Skyvia supports all the common actions for Discourse.