Skip to main content

Pipedrive

In this example, we will show you how you can get started working with the Pipedrive API and produce a working use case that allows you to list all of the Organizations in your Pipedrive CRM.

Before you start

You'll need to get an API token that is valid for the CRM you want to access. Find out how to set that up in the Pipedrive Authorization documentation.

Install & Authorize Superface

The Superface CLI provides all the tooling needed to author the Comlinks for your integration.

Install with Homebrew
brew install superfaceai/cli/superface

If you don't have a Superface account already, you can sign up here. You can use your account to authenticate the CLI.

superface login

Prepare the documentation

Pipedrive's documentation is available as an Open API 3 specification document that is regularly maintained. Use this for a complete index of their API capabilities.

superface prepare https://developers.pipedrive.com/docs/api/v1/openapi.yaml pipedrive

Once the documentation has been indexed, you can create a profile for the use case you want to achieve.

superface new pipedrive "list all organizations"

A file called organizations-management.get-collection.profile will be created in the superface folder as a result of. This is a Comlink file that decribes the input and output expectations that the API expects to achieve this use case.

To turn the Comlink profile into runnable code in either Node.js or Python, use the following command and include the name of the provider and a use case profile you want to work with.

superface map pipedrive organizations-management/get-collection

Add your API key

If you don't already have your Pipedrive API key in your environment, you can add it to your .env file as PIPEDRIVE_API_KEY=<your-pipedrive-api-key>".

For help finding your Pipedrive API Key, please refer to their How to find the API token documentation.

Set up your inputs

In order to list the organizations correctly, you will need to modify the boilerplate code from the Pipedrive documentation so it contains a real request object. From the superface folder, open organizations-management.get-collection.pipedrive.mjs (or .py if you created Python files) and modify the object in the usecase.perform() function.

organizations-management.get-collection.pipedrive.mjs
{
start: 0,
limit: 10,
sort : 'name ASC',
},

Test it

To test it you can use the execute command.

superface execute pipedrive organizations-management/get-collection

If successful, you will see a JSON response listing the contacts in your CRM workspace.