This guide walks Salesforce Admins through setting up an integration between Salesforce and OnPage. The integration allows you to send alerts from Flow and receive replies back into Salesforce via OnPage’s webhook callbacks.
You’ll create custom fields, a public site for callbacks, metadata settings for tokens, and install the required Apex classes and permissions.
Step 1: Add Custom Fields to Case
Navigate to:
Setup → Object Manager → Case → Fields & Relationships → New
Create the following two fields:
1. OnPage_Updates__c
- Field Type: Long Text Area
- Label: OnPage Updates
- Length: 32000
- Visible Lines: 10
- Permissions: Add to all page layouts, grant Read/Edit access
2. OnPage_Message_ID__c
- Field Type: Text
- Label: OnPage Message ID
- Length: 36
- Permissions: Add to all page layouts, grant Read/Edit access
Step 2: Create a Public Site
Navigate to:
Setup → Sites → New
- Site Label: OnPage Webhooks
- Site Name: OnPageWebhooks
- Default Web Address:
onpagewebhooks
- Active Site Home Page:
UnderConstruction
- Click Save
You’ll return to this site later to configure public access once the Apex classes have been added.
Step 3: Create a Custom Metadata Type
Navigate to:
Setup → Custom Metadata Types → New Custom Metadata Type
- Label: OnPage Settings
- Object Name:
OnPage_Settings
- Plural Label: OnPage Settings
- Click Save
Add the following Custom Fields:
Field: Bearer Token
- Type: Text (255)
- Field Name:
Bearer_Token__c
Field: Default Callback URL
- Type: Text (255)
- Field Name:
Default_Callback_URL__c
Then go to Manage Records → New and create:
- Label: Default
- Bearer Token: Your OnPage API Bearer Token
- Default Callback URL: URL from your Site, e.g.
https://[your-subdomain].force.com/services/apexrest/onpagecallback
Step 4: Add Apex Classes
Navigate to:
Setup → Apex Classes → New
Paste and save each class from the GitHub repo, one at a time:
OnPageSendPageFlowAction
Sends an OnPage alert using Flow inputs like recipient, subject, and body.OnPageAddReplyFlowAction
Sends a reply to an existing OnPage alert, pulling the comment and related message ID automatically.OnPageCallbackController
Listens for incoming webhooks from OnPage and updates the case with reply data.
Step 5: Configure Site Public Access
Return to your previously created site from Step 2.
Click Public Access Settings, then:
Apex Class Access:
Add the following classes:
OnPageCallbackController
OnPageSendPageFlowAction
OnPageAddReplyFlowAction
Object Permissions:
- Object: Case
- Grant: Read, Edit
Step 6: Create a Permission Set
Navigate to:
Setup → Permission Sets → New
- Label: OnPage Integration Access
- Save the Permission Set
Add the following:
Apex Class Access:
OnPageCallbackController
OnPageSendPageFlowAction
OnPageAddReplyFlowAction
Object Settings → Case:
- Access Level: Read
- Field Permissions:
OnPage_Message_ID__c
: Read/WriteOnPage_Updates__c
: Read/Write
Assign this permission set to any user or integration user who will run the Flows.
Step 7: Add a Remote Site Setting
Navigate to:
Setup → Remote Site Settings → New
- Remote Site Name:
OnPageAPI
- Remote Site URL:
https://rest.onsetmobile.com
- Check Active
- Save
Step 8: Use in Flow Builder
After installing the classes and permissions, two Flow Actions will become available.
Action 1: Send OnPage Page
Inputs:
recordId
– Case record ID (automatically passed from context)recipientId
– OnPage escalation group or recipient ID- (Optional)
subject
– Defaults to Case Subject - (Optional)
body
– Defaults to Case Description - (Optional)
callbackUri
– Leave blank to use default - (Optional)
priority
– HIGH or LOW
The class auto-checks for an existing OnPage page with the same externalId
. Adds allowFreeTextReplies: true
.
Action 2: Add OnPage Reply
Inputs:
recordId
– CaseComment ID
This Flow Action will:
- Pull the body from the CaseComment
- Pull the message ID from the parent Case
- Send the reply to OnPage using
/pageReply
You do not need to manually pass the message ID or comment body.
Example Flows
Flow: Send OnPage Alert When a Case is Escalated
Trigger Settings:
- Object: Case
- Trigger: A record is created or updated
- Condition: sqlCopyEdit
Status Equals Escalated
Flow Action: Send OnPage Page
recipientId
: Your escalation group ID (e.g., 5658464)recordId
: The Case IDpriority
: HIGH- Leave optional fields blank to use defaults
Flow: Auto-Reply to OnPage When a Case Comment is Added
Trigger Settings:
- Object: Case Comment
- Trigger: A record is created
- Entry Condition: plaintextCopyEdit
ISBLANK({!$Record.Parent.OnPage_Message_Id__c}) = false && ISPICKVAL({!$Record.Parent.Status}, "Escalated")
Flow Action: Add OnPage Reply
recordId
: The Case Comment ID
Final Notes
- Customize Flow conditions based on Case Types, Owners, etc.
- Use LOW priority for non-urgent alerts
- You can extend the logic to fit more complex routing or escalation scenarios