Introduction:
In this blog, we’ll cover the steps that go into creating a custom connector for Pipedrive in Power Automate.
We already have a connector for Pipedrive in Power Automate but that connector offers very few actions. In this blog, we will see how we can create a custom connector for Pipedrive and add more actions to it.

Steps to get an ‘Access Token’ to authenticate Pipedrive:
- Go to your profile and click on “Personal preferences”

- Go to “API” tab and copy the API token.(it will be used in the authentication)

Pipedrive API Documentation: https://developers.pipedrive.com/docs/api/v1/
Creating Custom Connector (you can create a custom connector from PowerApps or from the Power Automate platform)
- Data –> Custom Connectors
- Click on “+ New custom connector” –> Create from blank

- Give a name to your connector and click on “continue”

General section
- You can upload a connector icon, background image, and description of your custom connector
- Provide Host(api.pipedrive.com)

- Click on Security to go to Next section
Security Section
- Select Authentication Type as “API Key”

- Enter Parameter label, Parameter Name and Parameter Location.
- Parameter label: API Key
- Parameter Name: api_token
- Parameter Location: Query

- Now Click on “Definition” to go to Next Section.
Definition section
- In Definition, you can create Triggers and Actions based on your requirements.
We will create an Action to Add new Organization in Pipedrive
Action for Adding New Organization:
- Click on “New Action”

- Enter Summary, Description and Operation ID

- Go to Request and Click on “Import from sample”

- Select the verb and add request URL to create new organization in Pipedrive.
Pipedrive API Documentation: https://developers.pipedrive.com/docs/api/v1/
Verb: POST
URL: https://api.pipedrive.com/v1/organizations
Body:
This is a sample body to create an organization in Pipedrive, you can get the sample body from API Documentation.
{
"name": "Vyas Store",
"address": "5, 943 Fincham Road, New Mexico 87503, US",
"address_street_number": null,
"address_locality": "Santa Fe",
"address_admin_area_level_1": "New Mexico",
"address_admin_area_level_2": "Santa Fe County",
"address_country": "United States",
"address_postal_code": "87503"
}
Important: We are already passing API token in Query while authentication so we don’t have to pass the API token again in URL.
Correct: https://api.pipedrive.com/v1/organizations (Enter Request URL without token)
Incorrect: https://api.pipedrive.com/v1/organizations?api_token=78224df8dbfbbc8 (This is an incorrect way don’t enter URL with API token)

A Request would look like the one given below:

Now let’s change a few things so that the connector is more friendly when someones use it in a flow.
- In the Request area, choose body then Edit.

- In the Parameter area, you now see all the parameters that the API expects to create a new Organization.

- We will make the name, address as required.
- select “name” click on more commands(…) and then click on edit.

- Enter Title and Set “Is required” to “Yes”

- Click on Back
- Repeat this for address.
- Add Response
Go to Response section and click on “+Add default Response”

NOTE: you can add sample response from the Pipedrive API Documentation

Paste the sample in “Body” and click on Import

- Once your Action is ready click on “Create Connector”

- Now click on “Test” to test your connector.
Test
- Create a connection to Pipedrive
- Click on “+New Connection”

- Enter the API token value.(Paste the API token we had copied from the Pipedrive)

- Enter the Organization Name and address


Using Custom Pipedrive connector in MS Flow.
- Go to Custom and select Pipedrive connector

- Click on “Custom Pipedrive” connector to see all the actions.
- Select the action.

- Enter the connection Name and API key and click on Create.


Running the flow:

New Organization in Pipedrive is created successfully.
