import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
sylius: {
type: "app",
app: "sylius",
}
},
async run({steps, $}) {
return await axios($, {
url: `${this.sylius.$auth.api_url}/api/v2/shop/product-variants`,
headers: {
Authorization: `Bearer ${this.sylius.$auth.oauth_access_token}`,
"accept": `application/ld+json`,
},
params: {
page: `1`,
itemsPerPage: `30`,
},
})
},
})
Sylius uses OAuth authentication. When you connect your Sylius account, Pipedream will open a popup window where you can sign into Sylius and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any Sylius API.
Pipedream requests the following authorization scopes when you connect your account:
POST
{{custom_fields.api_url}}/api/v2/shop/customers/token
accept: application/json
email={{custom_fields.email}}
&
password={{custom_fields.password}}
POST
{{custom_fields.api_url}}/api/v2/shop/customers/token
accept: application/json
email={{custom_fields.email}}
&
password={{custom_fields.password}}