> ## Documentation Index
> Fetch the complete documentation index at: https://moengage-analytics-query-api-docs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Capillary

# Introduction

[Capillary](https://www.capillarytech.com/products/loyalty-program-software/) Intelligent Loyalty platform delivers a comprehensive approach to customer loyalty solutions. The platform provides complete online, in-store, and social media-based loyalty to engage customers and positions your brand for efficient customer engagement.

# MoEngage × Capillary

The MoEngage and Capillary integration enables you to send dynamic coupon codes and customer loyalty data such as points, loyalty levels, and programs inside of MoEngage campaigns.

# Integration

<Info>
  **Prerequisites**

  * You would need your Capillary [API keys](https://docs.capillarytech.com/docs/api-client) to use their APIs.
</Info>

## Display customer rewards in MoEngage Campaigns

Using MoEngage's Content APIs, you can dynamically pull customers' reward points inside MoEngage campaigns for a more personalized experience.

### Step 1: Set up a MoEngage Content API

1. Navigate to **Settings** > **Advanced settings** > **Content API**. Click **+ Add content API** at the top right corner of the Content API screen. <img src="https://mintcdn.com/moengage-analytics-query-api-docs/Us2dbGMu1iG8wd99/images/partner_21979873442068.png?fit=max&auto=format&n=Us2dbGMu1iG8wd99&q=85&s=9f45a5df6efc70b1cb58a92611c2bce3" alt="ContentAPI_Navogation.png" width="2706" height="1344" data-path="images/partner_21979873442068.png" />
2. Add your Capillary API to the endpoint URL. Depending on your use case, the endpoint will change. <img src="https://mintcdn.com/moengage-analytics-query-api-docs/8Au5KYh0BKKNw_D1/images/partner_19899981002644.png?fit=max&auto=format&n=8Au5KYh0BKKNw_D1&q=85&s=c4dc6fe8e019bcf70ec11221d9ea6df5" width="2866" height="1562" data-path="images/partner_19899981002644.png" />
   To display your customers' rewards, use Capillary's [Get Loyalty Details API](https://docs.capillarytech.com/reference/get-loyalty-details-1).
   While setting up your content API, insert the following URL:
   `https://{host}/v2/customers/{{UserAttribute['capillary_id']}}/loyaltyDetails`
   Your host will depend on the server to which the API calls are made, usually the cluster URL.
   Under Headers, add the following:
   * `Authorization`: Use an online tool to create your basic auth with `username` as a username and your MD5 hash of your `password` as a password: <img src="https://mintcdn.com/moengage-analytics-query-api-docs/8Au5KYh0BKKNw_D1/images/partner_19899891659924.png?fit=max&auto=format&n=8Au5KYh0BKKNw_D1&q=85&s=2618b22da0e54bfb6d15532b25937263" width="1818" height="602" data-path="images/partner_19899891659924.png" /> In the above example, the value of this header would be `Basic dXNlcm5hbWU6Y0dGemMzZHZjbVE9`
   * `Content-Type`: `application/json`
   * `Accept`: `application/json`
3. 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 test your API response and validate it.
</Note>

### Step 2: Display your customers' loyalty points inside MoEngage campaigns

To use this API in your MoEngage campaigns,

1. On step 2 on your campaign creation, enter @.
2. In the pop up, you can select the Capillary Content API configured in Step 1.
3. You can use [MoEngage Templating Language](/user-guide/campaigns-and-channels/getting-started/message-personalization/jinja-templating-language) to parse through the API response and use the content in your campaigns. <img src="https://mintcdn.com/moengage-analytics-query-api-docs/8Au5KYh0BKKNw_D1/images/partner_19900120669204.png?fit=max&auto=format&n=8Au5KYh0BKKNw_D1&q=85&s=0ba4fecf1b8e550a54a19ac0470ecca8" width="2630" height="1466" data-path="images/partner_19900120669204.png" />
4. You can click on the Preview tab to view your campaign in real-time personalization: <img src="https://mintcdn.com/moengage-analytics-query-api-docs/8Au5KYh0BKKNw_D1/images/partner_19900156767764.png?fit=max&auto=format&n=8Au5KYh0BKKNw_D1&q=85&s=97ed10bcdfa8ce07c7f05737628bdbaa" width="2836" height="1468" data-path="images/partner_19900156767764.png" />
5. Once you are ready, click on **Publish** to send the campaign.
