Drift

The New Way Businesses Buy From Businesses

Go to site

Drift API Integrations

Build and run workflows using the Drift API. Use 1000s of source-available triggers and actions across 1000+ apps. Or write custom code to integrate any app or API in seconds.

Overview

The Drift API allows you to interact with all of the resources in Drift. This includes retrieving and updating conversations, retrieving and updating contacts, and more.

With the Drift API, you can build applications to:

  • Retrieve and update conversations
  • Retrieve and update contacts
  • Upload and retrieve files
  • Send and receive messages
  • And more!
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import { axios } from "@pipedream/platform"
export default defineComponent({
  props: {
    drift: {
      type: "app",
      app: "drift",
    }
  },
  async run({steps, $}) {
    return await axios($, {
      url: `https://driftapi.com/users/list`,
      headers: {
        Authorization: `Bearer ${this.drift.$auth.oauth_access_token}`,
      },
    })
  },
})

Authentication

Drift uses OAuth authentication. When you connect your Drift account, Pipedream will open a popup window where you can sign into Drift and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any Drift API.

Pipedream requests the following authorization scopes when you connect your account:

contact_readcontact_writeall_contact_readconversation_writeconversation_readuser_writeuser_readaccount_readaccount_writeplaybook_read
OAuth Request Configurations:
  1. authorization
    GEThttps://dev.drift.com/authorize?client_id={{oauth.client_id}}&redirect_uri={{oauth.redirect_uri}}&state={{oauth.state}}&response_type=code&scope={{oauth.space_separated_scopes}}
  2. accessToken
    POSThttps://driftapi.com/oauth2/tokencontent-type: application/x-www-form-urlencodedaccept: application/json
    client_id={{oauth.client_id}}&client_secret={{oauth.client_secret}}&redirect_uri={{oauth.redirect_uri}}&grant_type=authorization_code&code={{oauth.code}}
  3. refreshToken
    POSThttps://driftapi.com/oauth2/tokencontent-type: application/x-www-form-urlencodedaccept: application/json
    client_id={{oauth.client_id}}&client_secret={{oauth.client_secret}}&grant_type=refresh_token&refresh_token={{oauth.refresh_token}}