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

# Lob

# Introduction

[Lob](https://www.lob.com/) is an online service that allows you to send direct mail to your users.

# Integration

The MoEngage and Lob integration leverages MoEngage connectors and the Lob APIs to send mail like letters, postcards, and checks through the mail.

<Info>
  **Prerequisites**

  1. Ensure you have access to your Lob dashboard.
  2. Ensure that you have your Lob API key. Your Lob API key can be found under the settings section under your name in the Lob dashboard.
</Info>

## Step 1: Select Lob endpoint

The HTTP URL to request in the connector is different for each action you can make to Lob. In the following example, we use the postcards API endpoint `https://api.lob.com/v1/postcards`. Visit the [complete endpoint list](https://lob.com/docs#intro) to select the endpoint appropriate for your use case.

<img src="https://mintcdn.com/moengage/11KR3mwxT6FlowrU/images/partner_4455759370516.png?fit=max&auto=format&n=11KR3mwxT6FlowrU&q=85&s=2a1b6e1b8fe11a726c421dfbdb2836bd" alt="lob_api_endpoint.png" width="481" height="503" data-path="images/partner_4455759370516.png" />

## Step 2: Create connector campaign on MoEngage

To create a connector campaign on MoEngage,

1. Navigate to Create Campaign >> Connectors >> Custom

<img src="https://mintcdn.com/moengage/11KR3mwxT6FlowrU/images/partner_4455800640660.png?fit=max&auto=format&n=11KR3mwxT6FlowrU&q=85&s=9cfa93851efaa7d19dda1911be3814c2" alt="Screenshot_2022-02-21_at_10.48.46_PM.png" width="1104" height="1238" data-path="images/partner_4455800640660.png" />

2. On step 2 of the campaign, select -

#### a) URL details

<img src="https://mintcdn.com/moengage/11KR3mwxT6FlowrU/images/partner_4455954213396.png?fit=max&auto=format&n=11KR3mwxT6FlowrU&q=85&s=a26d101635e32aea154a0dfdb0894246" alt="Screenshot_2022-02-21_at_11.06.00_PM.png" width="2452" height="616" data-path="images/partner_4455954213396.png" />

Key

| Key         | Value                                                          | Notes                                                          |
| ----------- | -------------------------------------------------------------- | -------------------------------------------------------------- |
| Method      | POST                                                           |                                                                |
| Webhook URL | [https://your-lob-API-endpoint](https://your-lob-API-endpoint) |                                                                |
| URL params  | --                                                             | Optional; Needed only if your URL contains personalised values |

#### b) Headers

<img src="https://mintcdn.com/moengage/11KR3mwxT6FlowrU/images/partner_4455986787604.png?fit=max&auto=format&n=11KR3mwxT6FlowrU&q=85&s=b1f009c63a5dedb34d44f82592a80a56" alt="Screenshot_2022-02-21_at_11.09.42_PM.png" width="2080" height="280" data-path="images/partner_4455986787604.png" />

Add the following two headers

| Key           | Value                |
| ------------- | -------------------- |
| Authorization | Basic \<lob-API-key> |
| Content-Type  | application/json     |

#### c) Request Body

The following is an example request body for the Lob postcards endpoint. While this request body is provided in the base Lob template, if you wish to use other endpoints, you must adjust your Liquid fields accordingly. <img src="https://mintcdn.com/moengage/11KR3mwxT6FlowrU/images/partner_4455989176596.png?fit=max&auto=format&n=11KR3mwxT6FlowrU&q=85&s=71d9c5b81df85b4e6a7d13eea8397c1a" alt="Screenshot_2022-02-21_at_11.11.34_PM.png" width="872" height="468" data-path="images/partner_4455989176596.png" />

## Step 3: Test your configuration

At this point, your campaign should be ready to test and send. You can also test your connector configuration using the Test functionality available on Step 2 of Create Connector Campaign

<img src="https://mintcdn.com/moengage/11KR3mwxT6FlowrU/images/partner_4460621328788.png?fit=max&auto=format&n=11KR3mwxT6FlowrU&q=85&s=b318e4423cbe1aaa69e5e67a873d5b36" alt="Screen_Shot_2022-02-22_at_11.12.42_AM.png" width="2464" height="270" data-path="images/partner_4460621328788.png" />

Check the Lob dashboard once you test the configuration or trigger the campaign.
