import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
gusto: {
type: "app",
app: "gusto",
}
},
async run({steps, $}) {
return await axios($, {
url: `${this.gusto.$auth.environment}/v1/token_info`,
headers: {
Authorization: `Bearer ${this.gusto.$auth.oauth_access_token}`,
"Content-Type": `application/json`,
},
})
},
})
Gusto uses OAuth authentication. When you connect your Gusto account, Pipedream will open a popup window where you can sign into Gusto and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any Gusto API.
Pipedream requests the following authorization scopes when you connect your account:
publicwebhook_subscriptions:readwebhook_subscriptions:writeGET{{custom_fields.environment}}/oauth/authorize?client_id={{custom_fields.client_id}}&redirect_uri={{oauth.redirect_uri}}&response_type=code&state={{oauth.state}}POST{{custom_fields.environment}}/oauth/tokencontent-type: application/x-www-form-urlencodedaccept: application/jsonclient_id={{custom_fields.client_id}}&client_secret={{custom_fields.client_secret}}&redirect_uri={{oauth.redirect_uri}}&grant_type=authorization_code&code={{oauth.code}}POST{{custom_fields.environment}}/oauth/tokencontent-type: application/x-www-form-urlencodedaccept: application/jsonclient_id={{custom_fields.client_id}}&client_secret={{custom_fields.client_secret}}&grant_type=refresh_token&refresh_token={{oauth.refresh_token}}