Introduction
Livingdocs is a modern digital content creation and publishing system in use at a wide variety of media companies.
MoEngage <> Livingdocs
With the MoEngage and Livingdocs integration, you can edit and manage all your templates inside Livingdocs and pull them dynamically inside MoEngage campaigns to send out up-to-date articles to your customers.
Integration
library_add_check |
Prerequisites
|
Embed Livingdocs templates inside MoEngage Campaigns
Using MoEngage's Content APIs, you can dynamically pull the latest copy of your templates from inside Livingdocs and send them to your customers.
Step 1: Set up a MoEngage Content API
info |
Information We've revamped our dashboard settings UI. Content API is now available in Settings -> Advanced Settings -> Content API in the revamped UI. For more information, refer to Summary of Changes - Settings UI Revamp. |
-
Navigate to Settings -> Advanced Settings -> Content API. Click + Add content API at the top right corner of the Content API screen.
Navigate to Settings >> APIs >> Content API. Click Add.
- Add your Livingdocs API to the endpoint URL. Depending on your use case, the endpoint will change.
We will make use of Livingdocs' Composition API to fetch the HTML content of your templates.
While setting up your content API, insert the following URL:
https://server.livingdocs.io/api/beta/composition/<document_id>
To find your document ID, open your document inside LivingDocs and look at the URL:
Under Headers, add the following:-
Authorization
:Bearer <your-access-token>
-
Content-Type
:application/json; charset=utf-8
-
Accept
:application/json
-
- Select the method as POST
- Under Body, type the following:
{ "fields": [ "systemdata", "content", "metadata", "includes", "html" ], "resolveIncludes": true }
- Click on "Save" and then "Done" once you see a successful response.
- Note - You can also test your APIs. To test your APIs, from the Content API's action menu, click on "Test". You can your API response and validate it.
Step 2: Display your template inside MoEngage campaigns
To use this API in your MoEngage campaigns,
- On step 2 on your campaign creation, enter @.
- In the pop up, you can select the Livingdocs Content API configured in Step 1.
- You can use MoEngage Templating Language to parse through the API response and use the content in your campaigns:
{% set response = ContentApi.LivingdocsIntegration2({({"params":{},"static_params":{},"dynamic_params":{},"request_body":{"fields":["systemdata","content","metadata","includes","html"],"resolveIncludes":"true"}})}) %} {% for block in response.content[0].containers.main %} {% if block.component == "free-html" %} {{ block.content['free-html'].html }} {% endif %} {% endfor %}
- You can click on the Preview tab to view your campaign in real-time personalization:
Using Dynamic Blocks inside MoEngage Campaigns
At times, you might want to use a dynamic piece of code that remains the same throughout MoEngage campaigns across templates. You can achieve this with MoEngage Content Blocks:
- On your MoEngage Dashboard side navigation menu, go to Content >> Content Blocks.
- Click on "Create content block".
- Create your content block. It can either be of type Plain text or HTML:
- Once you are ready, copy the block label. You will need to type this inside Livingdocs template editor.
Next, go to the Livingdocs template editor, and paste the block code:
That's it! Your content block will automatically be added to the place where you inserted this code: