Skip to content

Kentico/xperience-zapier-cli

Repository files navigation

Zapier CLI integration

A native Zapier application to integrate Xperience 13 websites with Zapier and thousands of its available applications. This integration allows you to create Zaps which trigger when actions are taken in your Xperience application, and does not require a paid Zapier account.

Zapier integrations

You can read more about the native Zapier integration here: https://zapier.com/apps/kentico-xperience/integrations.

Triggers

  • Catch Xperience Webhook: Triggers when a POST request is sent from your Xperience Portal Engine/.NET Core application. Requires the custom module to be installed on the project.

Actions

  • Create New Object: Creates a new object of selected type in your Xperience application.
  • Create New Page: Creates a new page in the content tree of the selected page type. See the example for details.
  • Update Page: Updates an existing page in the content tree based on the NodeAliasPath. See Updating pages.
  • Update Object: Updates an existing site or global object. See Updating objects.
  • Move to Next Step: Moves a page under workflow to the next step.

Searches

  • Find Page: Search for a page in your content tree based on a SQL query

Installing the custom module

⚙️ Optional!

This custom module makes it easy to manage webhooks in the Xperience interface, and automatically submit POSTs to Zapier when data is modified in the CMS. However, you can still use this integration's actions (like Create New Page) without installing the module.

If you'd rather manage everything in Zapier, and you'd like to trigger Zaps without installing the custom module, skip to Triggering Zaps without the custom module. To install and use the custom module, follow the instructions in that repository.

Enabling REST

The native Zapier application uses Xperience's REST endpoint to authenticate requests and obtain data from your site. REST must be enabled and configured properly to use the Zapier integrations, regardless of whether you are using the custom module or not.

Follow our instructions for enabling the REST service, including all server configuration, Xperience settings, and the runAllManagedModulesForAllRequests attribute. Consider also enabling the Allow sensitive fields for administrators setting if you'd like to get/set sensitive fields (e.g. UserPassword).

Triggering Zaps without the custom module

  1. Create a new Zap on http://zapier.com using the Webhooks by Zapier app and the Catch hook action

  2. Copy the Custom Webhook URL in the trigger

  3. In Xperience, determine when and how the Zapier trigger should be fired. For example, it could be within a custom workflow action, a custom marketing automation action, or an event handler

  4. In your code, use HttpClient to send a POST request to the Custom Webhook URL with a body that contains the information you need in the Zap

Creating a webhook

⚠️ These steps assume you have installed the custom module

  1. Create a new Zap on http://zapier.com which should fire when an action occurs in Kentico

  2. In step 1 of the Zap, use the Kentico Xperience app and the Catch Xperience Webhook event

selectapp

  1. Click Continue. On the next step, you need to provide the URL of your Xperience administration website, and the credentials of a user on the site with sufficient REST permissions

🌐 If you are running Xperience locally, you can use ngrok to make it accessible.

  1. After authenticating, select the object type and action that should trigger this Zap. Create a name for the webhook that will appear in the Xperience administration, following Xperience's code name conventions:

triggerconfig

  1. On the next step, click Test trigger button. You should shortly see “We found a request!” with sample data from your Xperience project for the selected object type.

  2. Set up the rest of your Zap actions. For testing purposes, you could just use a Code by Zapier action with the default configuration

  3. Turn on the Zap! When the Zap is turned on, the webhook is automatically created in your Xperience project and you can go to the Zapier application to view it. Perform the action that triggers the Zap, then check Task history in Zapier to see the results

Updating pages

With the Update Page action, you can update standard page fields and custom fields of existing pages in your content tree. You only need to supply the NodeAliasPath of the page and (optionally) the culture version to update.

update page

The format of the JSON is the same as described in our REST documentation. You can update as many or as few fields as you'd like- existing data not included in the JSON body are not modified.

Updating objects

Using the Update Object action, you can update an existing site or global object. For example, settings keys can apply globally to all sites, but each site can also have its own key value. To update a site's custom settings key, you could follow this example:

updateobject

Example - Synchronizing Google Calendar events with Xperience

Xperience setup

  1. Create a page type for displaying events in your Xperience site

eventtype

  1. On the Allowed types tab, set the Allowed parent page types to CMS.Folder (or any other page type you want to create events under)

  2. Add the parent page to the content tree

parentpage

Zapier setup

  1. Create a new Zap using the Google Calendar app and New Event trigger. Connect to your Google account and choose the calendar you wish to synchronize

calendartrigger

  1. In the next step, choose the Kentico Xperience app and Create New Page action

xperienceaction

  1. In the Customize Create New Page menu, use the drop-downs to select the dynamic fields from the trigger. For example, for the page type's StartDate field, choose Event Begins from the trigger.
    Make sure to set the Parent Page path to the page created in step 3 of the Xperience setup

customfields

  1. Turn on the Zap! When you create a new event in Google Calendar, you should see a new page in the Xperience content tree. You could also create another Zap using the Event Cancelled trigger in Google Calendar, to delete the page in Xperience when the event is deleted.

Compatibility

The Zapier integration represented by this repository should work with all versions of Kentico Xperience (custom module excluded), but has only been tested with Kentico Xperience 13 websites.

Feedback & Contributing

Check out the contributing page to see the best places to file issues, start discussions, and begin contributing.

License

The repository is available as open source under the terms of the MIT License.

About

A native Zapier integration which allows developers to handle events in the CMS and integrate with Zapier for automation.

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks