> For the complete documentation index, see [llms.txt](https://samwad.gitbook.io/samwad.tech-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://samwad.gitbook.io/samwad.tech-documentation/integrations.md).

# Integrations

## SAMWAD X Zapier Integration

Want to integrate your CRM or any other software with SAMWAD? You can do that easily with Zapier.

In this doc, we've listed down a step-by-step process you need to follow to connect your preferred software with SAMWAD via Zapier.

Pre-requisites to connect Zapier with SAMWAD

Here are a few things you must have to connect your Zapier account with SAMWAD:

* You must have an active SAMWAD account. If you don't, make sure to sign up now.
* Your WhatsApp Business API must be live.
* Your Facebook Business Manager account must be verified (to connect with Unlimited users).

&#x20;

Steps to connect SAMWAD with your preferred software via Zapier

1. Go to Zapier & click on "Create a Zap" to integrate your software with SAMWAD.

<figure><img src="/files/P7H8t8EdkARop5M8gEwI" alt=""><figcaption></figcaption></figure>

2\. Click the Trigger button to select a triggered action as per your needs. It can be anything from your internal CRM or other software like Calendly, Zoom, Instamojo, Razorpay, Convertkit etc.

<figure><img src="/files/F9umauFtl8oGrkEcNoXm" alt=""><figcaption></figcaption></figure>

3\. Search & select a Trigger that will help start your Zap

Here, we're going to integrate SAMWAD with Razorpay via Zapier. So, we'll be searching for Razorpay and selecting an event from it such as payment captured, or payment failed as a trigger.

<figure><img src="/files/MLPAzeUIZQ6Y6pgPp6Xn" alt=""><figcaption></figcaption></figure>

4\. Now to connect to SAMWAD to send a WhatsApp message on the selected trigger in Razorpay in the action box Search for "Webhooks by Zapier.

<figure><img src="/files/k83e0cErcvPxYbFcovOb" alt=""><figcaption></figcaption></figure>

&#x20;

5\. Tap on Webhooks by Zapier and under events select "Custom Request.

<figure><img src="/files/bx5X55hH4wQRVKhxjZav" alt=""><figcaption></figcaption></figure>

6\. Fill in the necessary fields

* Under Method, choose POST
* Under URL, add this exact URL - <https://backend.samwad.com/campaign/t1/api/v2>

<figure><img src="/files/vB6XjCq3hFpiEt4YCIuO" alt=""><figcaption></figcaption></figure>

Now for the Data field, you need to create a jason curl, which can be done by following steps 7 to 9&#x20;

Important Note: To go ahead with the next set of steps, make sure you have your SAMWAD account set. If you haven't yet setup your account, then signup on SAMWAD for FREE and set up your WhatsApp Business API account now

&#x20;

7\. In SAMWAD dashboard, go to API, click on API Campaign and select create new Campaign

<figure><img src="/files/fjEv522NZCOuKSsEBERr" alt=""><figcaption></figcaption></figure>

8\. Add a Campaign name, select a pre-approved template to which you wish to send using the campaign & click on Apply.

Under Campaign name, add the name of your Campaign which can be anything that describes your audience and goals. E.g. "Zapier Automation"

For Template, you need to create & approve a template message beforehand to make the campaign live in SAMWAD.

Note: Make sure your WhatsApp template message is created & approved before creating the API Campaign.

&#x20;

9\. Integrating SAMWAD with your CRM/ Software

For this step, you would need your development team to help you out with the integration process.

Now in Zapier create the JSON key as per the details shared below

HTTP Request

&#x20;

{\
"apiKey": string,\
"campaignName": string,\
"destination": string,\
"userName": string,\
"source": string,\
"media": {\
"url": string,\
"filename": string\
},\
"templateParams": \[\
string\
],\
"tags": \[\
string\
],\
"attributes": {\
"attribute\_name": string\
}\
}

&#x20;

Send notifications to users through API:

NOTE: In case of a new user (i.e. the user doesn’t exist on your contact list in SAMWAD Platform) then a new contact will be created with the incoming details.

&#x20;

Populate the Jason key stings against each attribute according to the table below

| Fields            | Description                                                                                                                                                                                                                                                                                                                                |
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| apiKey            | <p>string<br>​<br>​Required. API key generated from the dashboard.</p><p>Go to manage> API Key >Copy the key</p>                                                                                                                                                                                                                           |
| campaignName      | <p>string<br>​<br>​Required. Name of the campaign which has to be sent to the user. The status of the campaign should be ‘Live’.</p><p> </p><p>Go to campaigns> Copy the name of the API campaign created</p>                                                                                                                              |
| Destination       | <p>string<br>​<br>​Required. Mobile number of users with country dial-code to whom the campaign has to be sent.<br>e.g. – +917428526285 (India)<br>It's recommended to provide it in +(country code)(phone number) format. If a phone number can't be resolved to any country then, it is by default considered to be from India(+91).</p> |
| username          | <p>string<br>​<br>​Required Name of the user to whom the campaign has to be sent.</p>                                                                                                                                                                                                                                                      |
| Source            | <p>string<br>​<br>​Optional. Source of lead. It is to create a source-based segment to re-target.<br>e.g.- ‘Facebook forms’, ‘Website lead’, ‘Youtube lead’</p>                                                                                                                                                                            |
| Media             | <p>object<br>​<br>​Optional. URL & filename of media that has to be sent with the template message.</p>                                                                                                                                                                                                                                    |
| Location          | <p>String</p><p><br>Required. latitude, longitude, name & address of location that has to be sent with the template message.</p>                                                                                                                                                                                                           |
| templateParams\[] | <p>string<br>​<br>​Optional. An array of parameter values to fill in a template message</p><p> </p><p>If there is any dynamic value included in the template message enter the details of it. Multiple values are separated by comma</p>                                                                                                   |
| tags\[]           | <p>string<br>​<br>​Optional. An array of tag names to assign to the user.</p>                                                                                                                                                                                                                                                              |
| attributes        | <p>object with key-value pairs. The only string is allowed as the key's value.</p><p> </p><p>Optional. The object should contain keys already added as assistant attributes paired with values that you want to set as user's attributes.</p>                                                                                              |

Example Postman Request

Step 1 - Setup request type to "POST"

Step 2 - Setup URL

Step 3 - Choose body type "raw"

Step 4 - Select "JSON" type

Step 5 - Set content of the request

&#x20;

<figure><img src="/files/U3NVifiEIdKttU8aN6eP" alt=""><figcaption></figcaption></figure>

NOTES:

* Optional fields are not necessary for the request payload
* The medial URL provided in the media object should be publicly accessible, otherwise, the request will be rejected
* The length of the template params array should be equal to the number of params required in the campaign whose name is provided in campaign Name field. Otherwise, the request will be rejected
* Tags should be created in your project before using them. It can be done by anyone with manager level access
* If a tag doesn't exist in your project, it will be ignored
* Attributes should be added to the project before using them. It can be done by anyone with manager level access

If an attribute doesn't exist in your project, it will be ignored

10\. Once you have filled all the data, fill in the next fields as below

* In Data Pass-Through choose "False"
* For Unflatten choose "Yes"
* In headers fill "Content-Type", in Enter Test field add "application/json"

You can do the testing part in Zapier too by clicking the Test Zap option.

You've successfully used Zapier to connect SAMWAD with your CRM/ preferred software which in this case is Razorpay.

&#x20;

&#x20;
