Webhooks are push notifications, or callbacks, which allow users to stay up-to-date on the status of their objects without needing to poll for updates.Webhooks automatically send specified data to a destination (endpoint) from database events.
Our PM app utilizes webhooks for many of our features, such as updating tracking information for Print & Mail records and creating new Print & Mail records.
Anytime an event occurs like Letters, Checks, or Postcards are created or updated in Lob, a Webhook Event record gets created in Salesforce. Each Webhook Event record contains the full JSON payload of what occurred, which is processed automatically in Salesforce. The Webhook Event details are used to insert or update the related Print & Mail record in Salesforce.
We suggest using Webhook Events for troubleshooting and/or tracking what records are created or have been updated in Salesforce.
SetupIn the Quick Find, type in and click "Sites."
- If a Force.com domain has not been setup continue with the instructions, otherwise navigate to the next step (Site Configuration).
- Enter a value for your Force.com domain and click check availability
- Click New next to Sites.
- Set a Site Label, Site Name, and Default Web Address (We suggest using
- Check the
- On the active Site home page field click the
Lookupicon and select InMaintenance (the page is not visible, it's just a placeholder because a value is required).
Require Secure Connections (HTTPS).
- Click Save.
- Click on
Public Access Settingsbutton
- Navigate to Enabled Apex Class Access part and click
- From the Available Apex Classes add cp_address.REST_Webhook to the enabled column and save it
- Within the same Public Access Settings page click
- Navigate to the Custom Object Permissions Part and select the Read and Create checkboxes next to Webhook Events and save it
- Navigate to your connected Lob account dashboard
- Select the Webhooks tab on the left hand side
- Click on the
Createbutton at the top
- In the URL field set the url to the Salesforce webhook Site you just created
- Select the Event Types according to your business requirements