---
title: Leads Integration | Integrations
description: You can connect and push enquries from your landing pages directly into the Sembark.
date: 2022-10-02
---

# Leads Integration

2022-10-02 · by Sudhir Mitharwal

You can connect and push enquries from your landing pages directly into the Sembark.

## Create Integration

Visit your *Organization's settings* page from the top right dropdown. Then visit *Integrations* tab to view all your integrations.

From here, click on `New Integration`. Provide a name and description to your integration and hit submit. On the next screen, copy the `access token` to a safe place.

## Integrate

Using the access token from previous step, you can access the [Trip Plan Requests API](https://sembark.com/travel-software/apis/trip-plan-requests/). If you are already collecting leads from your landing pages, then you just need to forward these calls to Sembark APIs.

::: danger

You should **NEVER** put the Sembark API **Access Tokens** in the source code of your **public sites** (e.g. landing pages, marketing site, product site etc). If someone gets your token, they can use it to abuse your API usage.

:::

Following the [Trip Plan Requests API docs](https://sembark.com/travel-software/apis/trip-plan-requests/), here are sample code references to put on your **servers**. Here is a sample code for NodeJs projects to forward the form submissions to Sembark APIs.

::: tip

If you are using **WordPress with Contact Form Plugins**, you might want to checkout out guidelines on [WordPress integrations](..).

:::

```javascript
var axios = require("axios");
// assuming you already have guest_name, phone_number variables
var config = {
  method: "post",
  url: `https://api.sembark.com/integrations/v1/trip-plan-requests?name=${guest_name}&phone_number=${phone_number}`,
  headers: {
    Accept: "application/json",
    Authorization: "Bearer <TOKEN_HERE>",
  },
};
axios(config)
  .then(function (response) {
    // show the response.data.message
    console.log(JSON.stringify(response.data));
  })
  .catch(function (error) {
    // handle the errors for 401/422/405/500 etc
    console.log(error);
  });
```

## New Sites

If you aren't already collecting leads from your landing pages or you are just starting with your landing, you should first start collecting leads on your server.

### Client Side

This part covers the steps needs on your landing pages.

#### Create Form

To collect the leads, we will add a `form` on our landing page(s).

```html {1}
<form action="<SERVER_ENDPOINT_FOR_QUERIES_COLLECTION>" method="POST">
  <input
    name="guest_name"
    required
    type="text"
    placeholder="Your Name e.g. Rahul Mehta"
  />
  <input
    name="phone_number"
    required
    type="tel"
    placeholder="Your Contact Number e.g. +919999999999"
  />
  <hr />
  <button type="submit">Submit your Query</button>
</form>
```

### Server Side

#### Collection Endpoint

You will need a server to collect the leads. If your site is already hosted on a server that you own (e.g. wordpress site), you are good to go. If your site is statically distributed on a third-party hosting provider, the you will need to setup a server.

After you create a server, here are sample code for your reference to collect the leads.

```javascript
const express = require("express");
const bodyParser = require("body-parser");
const axios = require("axios");

const app = express();
// Configuring body parser middleware
app.use(bodyParser.urlencoded({ extended: false }));
app.use(bodyParser.json());

// this will create an `/queries` endpoint (post) on our server
app.post("/queries", (req, res) => {
  const data = req.body;
  // we will send this `data` to the Sembark APIs
  const config = {
    method: "post",
    url: `https://api.sembark.com/integrations/v1/trip-plan-requests?name=${data.guest_name}&phone_number=${data.phone_number}`,
    headers: {
      Accept: "application/json",
      Authorization: "Bearer <TOKEN_HERE>",
    },
  };
  return axios(config).then((resp) => {
    res.send(
      "Query submitted. Our sales executive will be in touch with you shortly.",
    );
  });
});

app.listen(80, () => console.log(`Hello world app listening on port 80!`));
```

## Integrations

Current page: [Leads Integration](https://sembark.com/travel-software/integrations/leads-integration.md)

### Get started

* [Leads Integration](https://sembark.com/travel-software/integrations/leads-integration.md)

### WordPress form plugins

* [WordPress Hustle Popup Contact Leads Integration](https://sembark.com/travel-software/integrations/wordpress-hustle-popup-contact-leads-integration.md)
* [WordPress WPForms Contact Leads Integration](https://sembark.com/travel-software/integrations/wordpress-wpforms-contact-leads-integration.md)
* [WordPress Quforms Leads Integration](https://sembark.com/travel-software/integrations/wordpress-quform-leads-integration.md)
* [WordPress MetForms Leads Integration](https://sembark.com/travel-software/integrations/wordpress-metform-leads-integration.md)
* [WordPress Formidable Forms Leads Integration](https://sembark.com/travel-software/integrations/wordpress-formidable-forms-leads-integration.md)
* [WordPress FluentForms Leads Integration](https://sembark.com/travel-software/integrations/wordpress-fluentform-leads-integration.md)
* [WordPress Elementor Contact Forms Leads Integration](https://sembark.com/travel-software/integrations/wordpress-elementor-contact-form-leads-integration.md)
* [WordPress Contact Forms API Integration](https://sembark.com/travel-software/integrations/wordpress-contact-forms-api-integration.md)

### Form builders

* [Google Form Leads Integration](https://sembark.com/travel-software/integrations/google-form-leads-integration.md)
* [Wix Forms Integration using Events in Velo](https://sembark.com/travel-software/integrations/wix-forms-integration-using-crm-backend-events-in-velo.md)

### Chatbots

* [BotPenguin Chatbot Leads CRM Integration](https://sembark.com/travel-software/integrations/botpenguin-chatbot-leads-crm-integration.md)
