import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
frontify: {
type: "app",
app: "frontify",
}
},
async run({steps, $}) {
const data = {
"query": `query MyQuery {
currentUser {
id
... on AccountUser {
email
}
}
}`,
}
return await axios($, {
method: "post",
url: `https://${this.frontify.$auth.domain}/graphql`,
headers: {
Authorization: `Bearer ${this.frontify.$auth.oauth_access_token}`,
},
data,
})
},
})
Frontify uses OAuth authentication. When you connect your Frontify account, Pipedream will open a popup window where you can sign into Frontify and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any Frontify API.
Pipedream requests the following authorization scopes when you connect your account:
basic:readGEThttps://{{custom_fields.domain}}/api/oauth/authorize?client_id={{oauth.client_id}}&redirect_uri={{oauth.redirect_uri}}&state={{oauth.state}}&response_type=code&scope={{oauth.space_separated_scopes}}&code_challenge_method=S256&code_challenge={{oauth.token}}POSThttps://{{custom_fields.domain}}/api/oauth/accesstokencontent-type: application/x-www-form-urlencodedaccept: application/jsonclient_id={{oauth.client_id}}&client_secret={{oauth.client_secret}}&redirect_uri={{oauth.redirect_uri}}&grant_type=authorization_code&code={{oauth.code}}&code_verifier={{oauth.verifier}}&scope={{oauth.space_separated_scopes}}POSThttps://{{custom_fields.domain}}/api/oauth/refreshcontent-type: application/x-www-form-urlencodedaccept: application/jsonclient_id={{oauth.client_id}}&client_secret={{oauth.client_secret}}&grant_type=refresh_token&refresh_token={{oauth.refresh_token}}&scope={{oauth.space_separated_scopes}}