import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
mindbody: {
type: "app",
app: "mindbody",
}
},
async run({steps, $}) {
return await axios($, {
url: `https://api.mindbodyonline.com/public/v6/class/classes`,
headers: {
"api-key": `${this.mindbody.$auth.api_key}`,
"siteid": `${this.mindbody.$auth.site_id}`,
"authorization": `${this.mindbody.$auth.oauth_access_token}`,
},
})
},
})
Mindbody uses OAuth authentication. When you connect your Mindbody account, Pipedream will open a popup window where you can sign into Mindbody and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any Mindbody API.
Pipedream requests the following authorization scopes when you connect your account:
POST
https://api.mindbodyonline.com/public/v6/usertoken/issue
accept: application/json
siteId: {{custom_fields.site_id}}
API-Key: {{custom_fields.api_key}}
Username={{custom_fields.username}}
&
Password={{custom_fields.password}}
POST
https://api.mindbodyonline.com/public/v6/usertoken/issue
accept: application/json
siteId: {{custom_fields.site_id}}
API-Key: {{custom_fields.api_key}}
Username={{custom_fields.username}}
&
Password={{custom_fields.password}}