import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
orderspace: {
type: "app",
app: "orderspace",
}
},
async run({steps, $}) {
return await axios($, {
url: `https://api.orderspace.com/v1/customers`,
headers: {
Authorization: `Bearer ${this.orderspace.$auth.oauth_access_token}`,
},
params: {
limit: `20`,
},
})
},
})
Orderspace uses OAuth authentication. When you connect your Orderspace account, Pipedream will open a popup window where you can sign into Orderspace and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any Orderspace API.
Pipedream requests the following authorization scopes when you connect your account:
POST
https://identity.orderspace.com/oauth/token
accept: application/json
client_id={{custom_fields.client_id}}
&
client_secret={{custom_fields.client_secret}}
&
grant_type=client_credentials
POST
https://identity.orderspace.com/oauth/token
accept: application/json
client_id={{custom_fields.client_id}}
&
client_secret={{custom_fields.client_secret}}
&
grant_type=client_credentials