Zapier

This guide explains how you can use Zapier to connect with the Midlane API

Summary

In order to connect an App with Midlane via Zapier, you need to create a new Zap. In our example we'll be using Pipedrive as the third party App.

During our guide we will need to do some data transformation to bring the data in the right format. This might not be the case for other Apps than Pipedrive.

Finally we’ll send data with a simple POST request to Midlane. During this step, we need to use a simple API key based authentication as described in the Authentication section.

This should finally create new candidate within Midlane.

Guide

Trigger Stage

The first stage is the trigger stage. In this step, we define when the Zap should be fired e.g. in the context of Pipedrive, whenever you drag a person into a certain stage. But it could also happen whenever you perform another action within another App e.g. press a button, update a record.

For our example with Pipedrive, we create this Trigger stage with the "Updated Deal Stage" event:

Then you need t choose your account with Pipedrive e.g. m****@midlane.com in my case. Here you have to login and authenticate likely. For other Apps, you might need to add an API key.

After that, we select the pipeline and stage as Trigger which we are going to listen to. Within Pipedrive we gave this stage the name "Sync to Midlane".

Now a new event is fired whenever you drag a person within Pipedrive to that stage.

Data Formatting

In this stage, we extract the first and last name with the Formatter by Zapier action. We do this in two separate steps with the help of Zapier. Depending on which App you are using for your Trigger step, the first and last name could also be provided via their API and the data formatting stage wouldn’t be necessary.

You could also make another API call to Pipedrive's API to get the details of a Person.

Overall we need the following data points to successfully send data to Midlane in the next step:

  • First name (Data Formatting Stage)

  • Last name (Data Formatting Stage)

  • Email (Provided via Pipedrive)

  • Mobile Phone Number (Provided via Pipedrive)

This is how it looks in our Zap.

Select the Formatter by Zapier event

We use the Format by Zapier stage and select the Split Text transform action. Then use the Person Name as Input which represents the full name of a person. As Separator chose [:space:].

Extract the first segment
Extract the last segment

What this will do is take the full name e.g. “Thomas Müller” and split it into parts by each space “ “. We do the same action twice with different Segment Indexes. One time First, then the other time Last.

This will enable us to get “Thomas” and then one time “Müller”.

A better implementation of this would likely call Pipedrive's API directy to obtain the details of this Person. Imagine a person with 2 first names e.g. Thomas Felix Müller. Our implementation would wrongly ignore the middle name.

Send data to Midlane

In this stage, we need to use the Webhooks by Zapier action. We need to choose the POST event type and point to the URL: https://app.midlane.com/api/public/candidates

Select json as payload and send the following data in the body as in the screenshot below.

It is important that you exactly type email, mobilePhoneNumber, firstName and lastName with the capitalization, for our API to recognize those data points.

More details about this API endpoint can be found here:

Candidates

Lastly we need to set the authentication of the POST request. For this step we need an API key from the Midlane dashboard.

If you haven't done yet, you can read here how to obtain one.

Authentication

Now, go to the Header section within Zapier as shown below. Exactly type Authorization in the field for Headers, then type Bearer MIDLANE_API_KEY and replace MIDLANE_API_KEY with the Api key that you obtained from the dashboard.

Again please exactly type the words with space between Bearer and your API key..

In the screenshot above, the API key is blacked out and starts with mdln_.

🎉 That’s it. You can now test if everything works. New candidates should be created and shown within Midlane.

Last updated