Creating a Custom Connector for Pipedrive in Power Automate

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:

  1. Go to your profile and click on “Personal preferences”
  1. Go to “API” tab and copy the API token.(it will be used in the authentication)

Pipedrive API Documentationhttps://developers.pipedrive.com/docs/api/v1/

Creating Custom Connector (you can create a custom connector from PowerApps or from the Power Automate platform)

  1. Data –> Custom Connectors
  2. Click on “+ New custom connector” –> Create from blank
  1. Give a name to your connector and click on “continue”

General section

  1. You can upload a connector icon, background image, and description of your custom connector
  2. Provide Host(api.pipedrive.com)
  1. Click on Security to go to Next section

Security Section

  1. Select Authentication Type as “API Key”
  1. Enter Parameter label, Parameter Name and Parameter Location.
  • Parameter label: API Key
  • Parameter Name: api_token
  • Parameter Location: Query
  1. Now Click on “Definition” to go to Next Section.

Definition section

  1. 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:

  1. Click on “New Action”
  1. Enter Summary, Description and Operation ID
  1. Go to Request and Click on “Import from sample”
  1. Select the verb and add request URL to create new organization in Pipedrive.

Pipedrive API Documentationhttps://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.
  1. 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

  1. Once your Action is ready click on “Create Connector”
  1. Now click on “Test” to test your connector.

Test

  1. Create a connection to Pipedrive
  2. Click on “+New Connection”
  1. Enter the API token value.(Paste the API token we had copied from the Pipedrive)
  1. 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.

Leave a Reply

Your email address will not be published. Required fields are marked *