Back

Drip API Essential Guide

Aug 14, 20246 minute read

What type of API does Drip provide?

REST APIs

  • REST (Representational State Transfer) APIs are very popular and widely used.
  • They use standard HTTP methods like GET, POST, PUT, DELETE for operations.
  • REST APIs are resource-based and use URLs to represent different resources.
  • They typically use JSON for data exchange.

GraphQL APIs

  • GraphQL is a newer API technology that allows clients to request exactly the data they need.
  • It uses a single endpoint and a query language to specify the data requirements.
  • GraphQL can be more efficient for complex data structures and reduces over-fetching of data.

SOAP APIs

  • SOAP (Simple Object Access Protocol) is an older protocol that uses XML for message formatting.
  • It's often used in enterprise environments and for interoperability between different systems.
  • SOAP has built-in standards for security and error handling.

Does the Drip API have webhooks?

Yes, the official Drip API does have webhooks. Here are the key points about Drip's webhook functionality:

Webhook Support

  • Drip offers webhook support, allowing you to receive HTTP POST notifications when certain events occur in your Drip account.

Event Types

You can subscribe to the following types of events via Drip webhooks:

  1. Subscriber-related events:

    • subscriber.created - Triggered when a new subscriber is created
    • subscriber.subscribed_to_campaign - Triggered when a subscriber is added to a campaign
  2. Tag-related events:

    • Applied a tag - Triggered when a tag is added to a subscriber
    • Removed a tag - Triggered when a tag is removed from a subscriber
  3. Custom events:

    • You can set up webhooks for custom events performed by subscribers
  4. Campaign-related events:

    • New campaign subscription added
  5. Order-related events:

    • Placed an order
    • Updated an order
    • Paid an order
    • Fulfilled an order
    • Canceled an order
    • Refunded an order

Setting Up Webhooks

There are multiple ways to set up webhooks in Drip:

  1. Account-wide webhooks: Configure global webhooks for your entire Drip account
  2. Rules: Set up webhooks as part of Drip Rules
  3. Workflows: Configure webhooks within Drip Workflows

Webhook Payload

The webhook payload is sent as JSON and includes details about the event and the affected subscriber or entity.

Best Practices

  • When setting up webhooks, make sure to specify the correct URL endpoint on your server to receive the webhook data.
  • Consider using webhooks for real-time updates to keep your systems in sync with changes in Drip.

By utilizing Drip's webhook functionality, you can create powerful integrations and automate processes based on events occurring within your Drip account.

Rate Limits and other limitations

Here are the key points about the API rate limits for the Drip API:

Rate Limits

  • The Drip API imposes a limit of 3,600 API calls per hour [1][2].

  • This limit applies to individual API requests across all endpoints, except for batch endpoints [2].

  • For batch endpoints, there is a separate limit of 50 requests per hour [2].

Batch Limits

  • Each batch request can include up to 1,000 records in the payload [2].

  • This allows for a total of 50,000 updates per hour via batch requests (50 requests * 1,000 records) [2].

Rate Limit Headers

  • API responses include rate limit information in the headers [2]:
    • X-RateLimit-Limit: Total limit (e.g. 3600)
    • X-RateLimit-Remaining: Remaining requests allowed

Exceeding Rate Limits

  • If you exceed the rate limit, the API will return a 429 Too Many Requests status code [2].

  • The response will include a message indicating the limit has been exceeded and to try again in an hour [2].

Best Practices

  • Monitor the rate limit headers to track your usage.
  • Implement backoff and retry logic for 429 responses.
  • Use batch endpoints for bulk operations when possible to maximize throughput.
  • Consider spreading requests over time to avoid hitting limits.

By adhering to these rate limits and implementing proper handling, you can ensure smooth integration with the Drip API while avoiding disruptions due to exceeding the allowed request volumes.

Latest API Version

Based on the search results, here are the key points about the most recent version of the Drip API:

API Version

The most recent version of the Drip API appears to be v2. This can be seen in the API endpoint URLs, which use the format:

https://api.getdrip.com/v2/YOUR_ACCOUNT_ID/...

Key Features

  • Uses REST API that communicates in JSON over HTTPS
  • Requires authentication using either an API token or OAuth 2.0
  • Supports operations on resources like workflows, campaigns, subscribers, etc.
  • Has rate limiting of 3600 API calls per hour

Authentication

Two main authentication methods are supported:

  1. API Token - For private integrations

    const client = require('drip-nodejs')({ token: YOUR_API_KEY, accountId: YOUR_ACCOUNT_ID });
  2. OAuth 2.0 - For public integrations

    const client = require('drip-nodejs')({ token: YOUR_ACCESS_TOKEN, tokenType: "Bearer", accountId: YOUR_ACCOUNT_ID });

Key Endpoints

The API provides endpoints for managing:

  • Workflows
  • Campaigns
  • Subscribers
  • Broadcasts
  • Triggers
  • Accounts

Best Practices

  • Use pagination when fetching large datasets
  • Handle rate limiting by deferring requests when limit is reached
  • Use promises or callbacks when making API requests
  • Include proper headers like User-Agent in requests

While an exact version number is not specified, the v2 endpoint and features described represent the most recent version of the Drip API based on the available information.

How to get a Drip developer account and API Keys?

Here's how to get a developer account for Drip to create an API integration:

Key Steps

  1. Sign up for a Drip account if you don't already have one.

  2. Log into your Drip account.

  3. Go to your account settings and look for the API section.

  4. Generate an API token, which will serve as your API key for authentication.

  5. For public integrations, you'll need to register your application with Drip to get OAuth credentials:

    • Go to the developer portal or OAuth application registration page
    • Provide details about your application
    • Enter a valid callback URL
    • You'll receive a client ID and client secret
  6. Choose the appropriate authentication method:

    • For private integrations, use your API token
    • For public integrations, implement OAuth 2.0 flow

Authentication Options

  • Private integrations:
    • Use your API token as the username with an empty password for Basic Authentication
  • Public integrations:
    • Implement OAuth 2.0 flow:
      1. Redirect users to Drip's authorization URL
      2. Receive an authorization code
      3. Exchange the code for an access token
      4. Use the access token for API requests

Code Example (Ruby)

require 'drip' client = Drip::Client.new do |c| c.api_key = "YOUR_API_KEY" c.account_id = "YOUR_ACCOUNT_ID" end # Make API requests using the client

What can you do with the Drip API?

Based on the search results, here are the key data models you can interact with using the Drip API:

Subscribers

  • Create, update, and list subscribers
  • Access subscriber details including email, custom fields, tags, etc.
  • Trigger events when subscribers are created or updated

Workflows

  • List all workflows
  • Activate/deactivate workflows
  • Start subscribers on specific workflows
  • Access workflow details and triggers

Campaigns

  • Manage single-email campaigns (broadcasts)
  • Manage email series campaigns
  • Access campaign details and metrics

Events

  • Record custom events for subscribers
  • Batch record multiple events
  • Access event data for segmentation and automation

Forms

  • Access form details and submissions
  • Use form submissions as triggers

Conversions/Goals

  • Track and access conversion data

Orders (for ecommerce)

  • Track order events like placed, updated, paid, fulfilled, canceled, refunded
  • Access order details and use for segmentation

Custom Fields

  • Create and manage custom fields for subscribers

Tags

  • Add/remove tags from subscribers
  • Use tags for segmentation

Key capabilities:

  • Subscriber management and segmentation
  • Email campaign creation and automation
  • Event tracking and behavioral targeting
  • Ecommerce integration and order tracking
  • Custom field and tag management
  • Workflow and automation management

The API allows you to programmatically manage most aspects of your Drip account, enabling deep integration with other systems and custom automation workflows.