# Klaviyo

## \[Beta] Flow Webhook

Allows Klaviyo users to create multichannel flows with 1send.

**Pre-Requisite:** Email address is passed as "ref" parameter in subscription link&#x20;

### Setup Integration

#### Create your 1send campaign template

Go to <https://app.1send.net/app/template>. Create template like standard campaign broadcast. Copy the `broadcastId` to use in webhook body later

#### Create a Klaviyo Webhook

Log into Klaviyo and navigate the "Flow" creator. Create a webhook action.

<figure><img src="https://863283473-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fwu9wR3vOsLFdcZHY032X%2Fuploads%2FnmAMh7Xtb1PuAAQmKYrR%2Fimage.png?alt=media&#x26;token=24952245-d555-45bd-b6f5-04bedf7ffc5b" alt=""><figcaption></figcaption></figure>

#### Customize you Webhook

First, start by giving your webhook a name. This is for internal use only

Then, set up the destination URL by entering the URL of 1send's API endpoint:

```
https://be.1send.net/webhook-campaign
```

Next, under the header section, enter the Key / Value pair for your API key. The Key will always have the value `x-token`.

The 'Value' field should be your API key. If you don't have an API key, contact 1send.

#### Set up the Webhook JSON Body

Use the template format to copy into the JSON Body area.

```
{
    "testSend":true,
    "broadcastId": "b_8abeb6b0-e218-4e73-a062-878bd2fe5fc2",
    "onesendId": "{{person.onesendId}}",
    "message": "HELLO",
    "visualURL":"http://res.cloudinary.com/dx0yoyivx/image/upload/v1713422752/e4lvplq4byrrs6vfvbvk.gif"
}
```

| Field       | Definition                                                                                                                        |
| ----------- | --------------------------------------------------------------------------------------------------------------------------------- |
| testSend    | Use if you want to test the webhook. There are NO quotes. **Remove for live version**                                             |
| broadcastId | ID of the template created on 1send                                                                                               |
| onesendId   | ID of subscriber message will be sent to                                                                                          |
| message     | Text message that will be sent to the subscriber                                                                                  |
| visualURL   | Optional. URL of image to be sent. **Overwrites uploaded image in the template**. Including if no image was uploaded in template. |

### Send Test Message

Make sure you are subscribed to the page. Go into subscribers and look for yourself. Click in.

Get the ID from the URL. This is your onesendId. This ID is unique per user per FB page. Use this in your webhook body for testing. You can either hardcode it or save it as custom property.

![](https://lh7-us.googleusercontent.com/docsz/AD_4nXehCpeSId3qV9RJxScaQOKP-4anFfixNIK-pkUnpmYHYf3mTDGKhWEOKdSQCyDCIKpWMhMbXhdrIdTQFaM7ZFrvQnEqocvnoL4a9uDUsTJzxPCogtcV_uimCdmGcu7EumTiSXEOZNeDOAAGGHyvePuNReU?key=tEd0-gfuiqyAwne7VOTPUw)

Add this to your Klaviyo profile under custom properties

![](https://lh7-us.googleusercontent.com/docsz/AD_4nXdj-6lFuv8SBnBn0WNvs17ggs7Hk-LUdLpQe050R0DXDXWYKCsBuimc5oz3l_u3KqJi6BxratkKmG7EKZwMDCfOSgWSbUTqe8CTnf2Se2sWdXjjM-c7R3j2KzHvUBEIepV4GhgcTTeWwxXHpxCcpAPbxdj1?key=tEd0-gfuiqyAwne7VOTPUw)

Include in the JSON body  `"testSend":true` **Remove this in the actual live version**

{% hint style="info" %}
**Important: Do this every time before testing**

From your FB user profile send a message to your FB page. Message content doesn’t matter.&#x20;

* This is to comply to Meta’s 24 hour rule for Pages to send messages to users without using Marketing Messages
  {% endhint %}

### Limits

* Image max size 8GB
* Message max 250 characters
