Purpose
Use the baseline features to allow integrations with third-party systems that are triggered from NetForum when a record is added or updated. This enables real-time integration with little to no code using IPaaS.
Requirements
Must have access to a NetForum site.
Tasks
Task 1: Create a Message Definition
When a webhook fires a message pertaining to the created or updated object will be created as a payload. This message will be sent to the webhook subscribers. The message format is normally in a pre-agreed format. For this example, create a simple JSON of individual data using SQL.
Main area: Admin > Integration > Integrations > Webhook Message
| Step | Action | Result |
| 1 | Goto Admin > Integration > Integrations | The system shows the integrations profile form. |
| 2 | Click + on the Webhook Messages. | The Add Webhook Message form shows up. |
| 3 |
Fill-in the form: Message ID: IndividualData + Your ID. For example: IndividualData-01. Object Key: Individual Data Format: JSON Description: Optional – put your name or something meaningful. Message Generator: SQL Message SQL: SELECT Click Save |
A webhook message created in the database. |
Sample screen:
Task 2: Define webhook subscribers
Normally, you work with a third-party app or vendor to define where the payload will be sent to. In this example, use a webhook testing web site to send the payload and inspect the results.
| Step | Action | Result |
| 1 |
Navigate to Admin > Integration > Integrations. Click the + to add Outgoing Webhooks. Fill-in the form: Name: WebhookSub + Your ID. For example: WebhookSub-01. |
A webhook subscriber initial metadata added. Note: The subscriber information is not yet fully defined. This will complete in the next step. |
| 2 | Find the Outgoing Webhook record you just created and click Go To | The Outgoing Webhook profile form is displayed. |
| 3 |
Update the Integration Settings as described below: Object: Individual Action: Insert Message Type: The message type you created above. Example: IndividualData-01.
URL: You will need a destination URL. So, keep the profile as is. Go the next step to get the U: IndividualData + Your ID |
Some integration settings of the webhook subscription defined, |
| 4 |
Setup a testing URL by navigating to this URL in a separate tab. Do not close this tab! A webhook testing URL is automatically generated. Copy the URL you will need it to complete the next steps. Go the NetForum screen and paste the URL in the value section for the URL setting. |
|
| 5 | Enter any value for the Secret Key and description. | Webhook integration settings are now fully defined. |
| 6 |
Click the Edit button to update the Integration itself. Check the Active flag. |
Integration is now marked as active. |
Note: Though the webhook integration is now active, there are no workflows to trigger the integration. That will be done in the next step.
Sample screen:
Task 3: Create a Workflow Trigger
Workflows are key to real-time integrations. They trigger one or more actions when a record is inserted or updated. A workflow can have multiple task types. In this step, create a workflow with only one task. The task is therefore marked as “Start” and “Stop”.
Workflow can be marked as “sync” (they are part of the insert/update thread) or async which they run separately after the insert/ update is completed. In this lab, use Async workflows.
| Step | Action | Result |
| 1 | Navigate to Toolkit > Workflow | Add workflow rule form is displayed. |
| 2 |
Fill-in the form as follows: Active: Unchecked Rule name: IndividualWorkflow + Your ID. Example: Workflow-01. Object: Individual Trigger on Insert: Checked Trigger on Update: Checked Trigger Async: Checked Order: Your ID, Example: 1 Click Save. |
A workflow rule is created. |
| 3 |
A workflow consists of one or more activities called Tasks. In this step add a workflow task to send a message to your webhook subscriber. Click the + sign on the Workflow Task. |
Add workflow task displayed. |
| 4 |
Fill-in the form as following. Task Name: WebhookSendTask + Your ID. Example: WebhookSendTask-01
Type: Program Code Start Task: Checked End Task: Checked
Under the Program Code Workflow: Assembly: netForumIntegrationPublishObject Object type name: netForumIntegrationPublishObject.WorkflowHandler Method to execute: WorkflowTaskHandler
Method Parameters: FacadeObject:f;Operation:o;string:WebhookSub-01 (Replace 01 with your ID) Click Save |
A workflow task added to the workflow rule. |
| 5 |
Activate the workflow Rule: Edit the workflow and set the “Active” flag to checked. |
A workflow is now active. |
Task 5: Clear cache
| Step | Action | Result |
| 1 |
Admin > Overview > Clear cache Click OK to confirm. |
Cached metadata is now cleared, and new metadata will be fetched from the database. |
Task 6: Verify
At this point, your webhook is now ready the message to your endpoint. Remember, adding a new individual fires any active workflow setup for the Individual object. As a result, other people action could trigger your workflow.
| Step | Action | Result |
| 1 | Check your workflow test listener which was open on the other tab. | You may or may not see any log. |
| 2 |
Add a new Individual Record: CRM > Individual > Add Individual. Fill-in the work and save. |
|
| 3 |
Switch to the webhook testing tab. You should be able to see a new post from NetForum: |
A message is posted to the external system. |
| 4 |
You should also be able to see a log in NetForum. You should see a log entry for your submission.
|
A log is created under the integration. |