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:read
GET
https://{{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}}
POST
https://{{custom_fields.domain}}/api/oauth/accesstoken
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}}
&
code_verifier={{oauth.verifier}}
&
scope={{oauth.space_separated_scopes}}
POST
https://{{custom_fields.domain}}/api/oauth/refresh
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}}
&
scope={{oauth.space_separated_scopes}}