1. Home
  2. Docs
  3. Guides
  4. Webhooks
Log a Case

Webhook Tracking Guide

An alternative solution to scheduled tracking for high-volume or express shippers

Overview

Zenkraft offers a Self-Service Webhook Tracking solution as an alternative to Scheduled Tracking. Webhook Tracking is ideal for customers who are tracking a high volume of Shipments, or who require updates as soon as possible.

There are three supported methods of adding webhook based tracking to your instance: using the Zenkraft Multi-Carrier Connected App, using a Custom Connected App, and using a Public Site.

For most users, our team recommends using the Zenkraft Multi-Carrier Connected App method. This method allows for a high volume of tracking updates, and utilizes a secure, authenticated connection to receive those updates.

If you would like to limit the access of our Managed Application, you also have the option of creating a Custom Connected App to facilitate the reception of tracking updates. This configuration process requires more steps than the Zenkraft Multi-Carrier Connect App method, but supports the same level of volume.

Finally, there is also the option of using a Public Site to receive Webhook Tracking updates. This option has the least secure connection and can support the lowest volume of all Webhook tracking methods. In rare cases, this may be the preferable solution. If you are considering utilizing Public Site-based Webhooks, please reach out to Zenkraft Support to verify if this may be a good solution for you.

NOTE: In order to utilize our Webhook tracking solutions, please ensure you are using Zenkraft Multi-Carrier Package Version 1.130.1 or later.

Zenkraft Multi-Carrier Connected App Webhooks

For most clients, the Zenkraft Multi-Carrier Connected App Solution will offer the best combination of simplicity of setup, security of connection, and support for high volume.

Create Webhook in Zenkraft Settings

To begin setting up Webhook-based tracking utilizing the ZK MC Connected App option, navigate to Zenkraft Settings and select the Tracking sub-tab.

Under the Webhooks section select Zenkraft Multi-Carrier Connected App as your Webhook type. You can leave Custom Domain blank. Hit save.

Grant Zenkraft API Access

You will then be asked to grant the Zenkraft API access to a number of different functionalities within your Salesforce Instance. Hit allow to proceed.

From there, if you have access to the Zenkraft API Dashboard, you will be redirected to your account's dashboard.

Within the API Dashboard you can click on the Webhook tab on the left side and confirm a Connected App Webhook has been created.

NOTE: If you do not have access to the Zenkraft API Dashboard, this will not have any negative affect on your ability to implement the Webhook solution. After clicking allow, simply close the tab that pops up.

Check and connect app

Navigate back to the tab where Zenkraft Settings is open. There should now be a button to Check and Connect App under the Webhook Section.

Click on this button. You should now see a Connected App Webhook appearing in your instance.

You have now successfully set up Webhook Tracking. Your next step is to reduce the frequency of any batch tracking jobs running in your instance.

Decrease frequency of schedule tracking

Scroll down to the Scheduled Tracking section.

Press the edit icon next to any schedulers which exist. A pop-up will appear where you can alter the cron expression to decrease frequency. You can decrease the frequency of the scheduled tracking job to once a day or or less to preserve Salesforce resources. Repeat for any remaining schedulers.

Custom Connected App Based Webhook Tracking

Create a custom app

Navigate to Setup and search for App Manager in the quick find box. After clicking into App Manager, select the New Connected App button.

In this new connected app enter a Name, API Name and Contact email.

Under API (Enable OAuth Settings) select the Enable OAuth checkbox. In the callback URL field paste the following URL: https://api.zenkraft.com/sf/oauth.
In the Selected OAuth Scopes select Manage User Data via APIs (api) and Perform requests at any time (refresh_token, offline_access).

Select the Require Secret for Web Server Flow checkbox.

Scroll to the bottom of the page and save, then continue.

Create an Integration User for webhook tracking

In the Setup quick box search Users then click the New User button.

Give the user a first and last name, an email, and a username.
Assign the user an arbitrary role. In the User License dropdown, select Salesforce Integration. Under Profile, select Salesforce API Only System Integrations.

Click save, then go to the email provided and complete the verification email from Salesforce.

NOTE: You may now be logged in as the Integration User, and encounter an error with the text “Access Restricted for API Only Users - You've successfully updated your permissions, and can no longer access the UI. Close this window to continue.”
To resolve this issue, open an incognito browser and log in to Salesforce as a System Admin. Open Setup and search for Session Management in the Quick Find Box. Find a session with the user you just created, select the checkbox next to this session and hit the remove button at the top. You should now be able to log in to Salesforce from a non-incognito browser from your normal user.

Assign permission set to your Integration User

Navigate to Setup and search permission sets. Look for Zenkraft - Tracking Permission Set and assign this to your new Integration User. CLick on Manage Assignments then Add Assignment.

Select your Integration User out of the list, then click Next, then Assign.

Run your App as your User

Return to Setup > App Manager and click Edit on the Connected App you just created.

Under the Custom Connected APp Handler heading click on the search function next to Run As and select the User you created, then save at the bottom of the screen.

Back within the Setup > App Manager navigate once again to your custom app and select Manage.

Click on Edit Policies.

Under Client Credentials flow select the search function next to Run As.

Select your newly created user.

Save, then navigate back to your Connected APp in App Manager and select View.

Click on Manage Consumer Details.

You will need to verify your user.

After the verification is complete you can view the Consumer Key and Consumer Secret

Copy these details and open Zenkraft Settings in a new tab.

Configure in Zenkraft Settings

Under Zenkraft Settings navigate to the Tracking tab, scroll to the Webhook heading and select Custom Connected App as your webhook type.

Enter Consumer Key into Client ID and Consumer Secret into Client Secret. You can leave the Custom Domain blank. Save your changes.

You have now set up Custom Connected App Based Webhooks. Please reduce the frequency of any tracking schedulers you are using.

Decrease frequency of schedule tracking

Scroll down to the Scheduled Tracking section.

Press the edit icon next to any schedulers which exist. A pop-up will appear where you can alter the cron expression to decrease frequency. You can decrease the frequency of the scheduled tracking job to once a day or or less to preserve Salesforce resources. Repeat for any remaining schedulers.

Public Site Based Webhook Tracking

Create a Salesforce Site

The first step in setting up Self-Service Webhook Tracking is to create a Site in Salesforce to receive tracking updates. You can create a new Site by navigating to Setup and searching for “Sites” in the Quickfind bar. From there, select New.

Once the Site Edits screen pops up enter a Site Label and Name (mentioning Zenkraft, tracking, and webhooks will help identify why the site was created later). Set your Active Site Home Page to ShipmentTrack and save your changes.

Press Activate on your newly created Site. Now it is time to configure Public Access Settings for your Site to ensure it is able to receive tracking updates and pass them along to the appropriate Zenkraft objects.

Configure Public Access Settings

Click on your Site label to view Site details. Select the Public Access Settings access settings button.

CLick on Edit and ensure that the Shipment, Shipment Info, Preference, Preference Info, Packages, Checkpoints, and Package Checkpoint objects all Read/Create permissions.

Click Save. Scroll down to the Enabled Apex Class Access.

Select Edit and add zkmulti.WCTrackingAPI to the list of Enabled Apex Classes. This connects the webhook payloads to the Zenkraft tracking object.

Save your changes. Now it is time to assign your site profile a Zenkraft license.

Assign Zenkraft License

At the top of the Public Access Settings Page click on View Users.

Click the Full Name of the user.

Click on Assign Licenses.

Assign a Zenkraft License and click on Add.

Add Your Site to Webhook Tracking Settings

The final step is to add your Site to Webhook tracking settings. Navigate to the Zenkraft Settings Tab, and click into the Tracking sub-tab. Press the plus sign under Webhooks.

Select Public in the resulting dropdown menu.

Select your site from the dropdown.

Click Save. This sends the site information to Zenkraft, so we know where to send the webhooks.

Once complete, follow the below instructions to reduce the frequency of any tracking jobs. The tracking status updates should now be sent via webhooks.

Decrease frequency of schedule tracking

Scroll down to the Scheduled Tracking section.

Press the edit icon next to any schedulers which exist. A pop-up will appear where you can alter the cron expression to decrease frequency. You can decrease the frequency of the scheduled tracking job to once a day or or less to preserve Salesforce resources. Repeat for any remaining schedulers.

Back to Top