import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
knocommerce: {
type: "app",
app: "knocommerce",
}
},
async run({steps, $}) {
return await axios($, {
url: `https://app-api.knocommerce.com/api/rest/surveys`,
headers: {
Authorization: `Bearer ${this.knocommerce.$auth.oauth_access_token}`,
},
params: {
format: `json`,
},
})
},
})
KnoCommerce uses OAuth authentication. When you connect your KnoCommerce account, Pipedream will open a popup window where you can sign into KnoCommerce and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any KnoCommerce API.
Pipedream requests the following authorization scopes when you connect your account:
POST
https://app-api.knocommerce.com/api/oauth2/token
?
grant_type=client_credentials
&
scope=responses+surveys
POST
https://app-api.knocommerce.com/api/oauth2/token
?
grant_type=client_credentials
&
scope=responses+surveys