import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
apollo_io_oauth: {
type: "app",
app: "apollo_io_oauth",
}
},
async run({steps, $}) {
return await axios($, {
url: `https://app.apollo.io/api/v1/users/api_profile`,
headers: {
Authorization: `Bearer ${this.apollo_io_oauth.$auth.oauth_access_token}`,
},
})
},
})
Apollo.io (OAuth) uses OAuth authentication. When you connect your Apollo.io (OAuth) account, Pipedream will open a popup window where you can sign into Apollo.io (OAuth) and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any Apollo.io (OAuth) API.
Pipedream requests the following authorization scopes when you connect your account:
read_user_profile
app_scopes
GET
https://app.apollo.io/#/oauth/authorize?client_id={{oauth.client_id}}&redirect_uri={{oauth.redirect_uri}}&response_type=code
POST
https://app.apollo.io/api/v1/oauth/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://app.apollo.io/api/v1/oauth/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}}