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:
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}`,
},
})
},
})
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_read
contact_write
all_contact_read
conversation_write
conversation_read
user_write
user_read
account_read
account_write
playbook_read
GET
https://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}}
POST
https://driftapi.com/oauth2/token
content-type: application/x-www-form-urlencoded
accept: application/json
client_id={{oauth.client_id}}
&
client_secret={{oauth.client_secret}}
&
redirect_uri={{oauth.redirect_uri}}
&
grant_type=authorization_code
&
code={{oauth.code}}
POST
https://driftapi.com/oauth2/token
content-type: application/x-www-form-urlencoded
accept: application/json
client_id={{oauth.client_id}}
&
client_secret={{oauth.client_secret}}
&
grant_type=refresh_token
&
refresh_token={{oauth.refresh_token}}