Making it easier to integrate with Contensis
Build integrations more easily with webhooks and server-sent events
When you're building modern digital products, it's no use having content that's stuck in any one system. Our goal in developing Contensis is to give you a way to create flexible and reusable content without constraint. That's why our Management and Delivery APIs allow you to create, manage and deliver that content any way you like.
Every day, a lot happens in a Contensis project. New users are added, content types are created, and entries go through publishing workflows. Our APIs make it easy to access this data and deliver it to other systems, but finding out when something had actually changed required you to poll your Contensis instance on a regular basis to see if anything had changed.
That's why today we're introducing webhooks and server-sent events to our toolkit.
Webhooks
Webhooks allow you to create real-time integrations with applications outside of Contensis. Our webhooks are flexible, allowing you to trigger a webhook on a variety of different conditions and to template your payload with Liquid.
Listen to any event
You can set up a webhook to fire on almost any type of event that takes place in Contensis. We call these events topics. The following topics will trigger a webhook when:
- an entry is created, updated, deleted, published or unpublished
- a user carries out a particular workflow action on an entry
- content transitions into a specific workflow state
- an asset is created, updated, deleted or published
- a content type or component is created, updated, deleted or published
- a user is created, updated or added to a group
- a node is created or updated in the Site View tree
You can further filter these topics to narrow down the conditions that will trigger a webhook. Depending on the topic you’re using you can filter events by content type, asset type, content owner, and language. Combining topics and filters gives you the granular control you need to keep your webhook specific to your integration.
Let’s say your head of communications wants to receive a notification in their Slack channel whenever a News story entry is ready for approval. You could do this by creating a webhook to fire when all entries of the Content type News story that are Owned by the Communications team and that are in Workflow state Awaiting approval are Created or Updated. Then in your payload you could include a link back to Contensis to allow the communications team to quickly approve or revoke the entry.
Do more with custom payloads
The message sent by a webhook to an endpoint is called the payload. We’ve provided different lightweight default JSON payload templates depending on the topic you’re using in your webhook. So, a webhook fired when a user is created will use a different default payload to one triggered by an entry being published, for example.
You can customise the default template, or completely replace it with your own custom template to meet the needs of your endpoint. Custom payload templates allow you to specify the exact data and structure expected by your endpoint. They are especially useful for services that have an incoming webhook feature, like Slack.
Both default and custom templates support Liquid as a templating language. Using Liquid gives you greater flexibility over the information you send in your payload. You can use it to apply logical filters, parse data into different formats or conditionally control the content that is sent in the payload.
By using templates that are more relevant to the trigger you’re using, you can send exactly the right amount of data to your endpoint to save on return API calls.
Get up and running with starter templates
We’ve provided pre-configured starter templates you can use to quickly integrate with several popular collaboration platforms. All you need to do is enter a few details such as the Content Type ID of the entries you want to trigger your webhook, an API key, and an endpoint URL.
Today we have starter templates for the following platforms:
- Monday.com – add an item to a board based on an entry transition
- Slack – notify a channel of entry changes using Slack's Block Kit syntax
- Teams – notify a channel of entry changes using Teams adaptive card layout
- Trello – add a card to a board
We’re looking to add more starter templates in future and we’d love to hear which platforms would be most useful to you. So, if you have a suggestion for a webhook template, let us know on Contensis Slack.
Understand and troubleshoot webhook activity
Sometimes the connection between a webhook and an endpoint will be interrupted – usually because the destination endpoint is unavailable at the exact moment the webhook is fired. If one of your webhooks fails, Contensis will try sending it 10 times using an exponential backoff algorithm. We’ve also provided full activity logs so you can check the status of your webhooks and get to the root of any issues.
Server-sent events
Webhooks are built on top of our new events microservice. This new service will allow us to build other new features that rely on monitoring activity in Contensis. The first of these new features is server-sent events (SSE).
A server-sent event occurs when a client application automatically receives an update from a server without needing to ask or poll the server to see if anything has changed. Server-sent events allow developers to update a user interface or website with real-time information without the page refreshing. They are great for building features that involve updating content in real time, such as live news feeds, product stock alerts, or service status pages.
For more background on webhooks and server-sent events, check out our recent webinar – Webhooks – don’t call me I’ll call you.
User and groups management
We've introduced user and group management into the new Contensis interface, so you no longer need to go back to Contensis Classic to manage the users in your environment.
We've also added the ability to search through your users with a variety of filters to report on things like the last time a password was changed or which users have logged in in the last 30 days. You can also export these reports as a CSV file if needed. Combined with managed columns you'll be able to see the data you need in these views.
You'll also see you can now update your user profile. We automatically bring in your Contensis.com avatar, so if you've uploaded a photo to our Slack community or Gravatar.com, you'll see it within the interface.
Other updates
In between building these new features, we’ve also found time to update a few other areas of Contensis.
Add markdown in the rich text editor
We've added a new toolbar option in the rich text editor that will allow you to add markdown which is automatically converted into rich text once inserted.
LaTeX and MathJax support
Our markdown editor now supports LaTeX and MathJax, so those of you who need to insert mathematical/scientific expressions can now do so using a markdown field.
Enrich your content guidelines with markdown
Our content guidelines fields also now support basic markdown allowing you to insert bold, italic and links in your field guidelines, making it easier to link to voice and tone guides and richer examples of expected content.
View the status of your Contensis environment
Hopefully you won't need it, but we've added a screen to aid in support requests that indicates what version of the Contensis CMS, user interface, and other services are being used for your Contensis environment.
Other new features and fixes
This release also includes other updates and improvements. For a full list of changes, check out our what’s new page.
Upgrade now
If you are a cloud customer, you can raise a support request today to schedule an upgrade to Contensis 15.
If you are currently using an on-premise version of Contensis, and want to find out more about moving to our cloud platform, get in touch to arrange a call from your account manager.