import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
workday: {
type: "app",
app: "workday",
}
},
async run({steps, $}) {
return await axios($, {
url: `https://${this.workday.$auth.domain}/ccx/api/v1/${this.workday.$auth.tenant}/workers`,
headers: {
Authorization: `Bearer ${this.workday.$auth.oauth_access_token}`,
},
})
},
})
Workday uses OAuth authentication. When you connect your Workday account, Pipedream will open a popup window where you can sign into Workday and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any Workday API.
Pipedream requests the following authorization scopes when you connect your account:
POST
https://{{custom_fields.domain}}/ccx/oauth2/{{custom_fields.tenant}}/token
content-type: application/x-www-form-urlencoded
accept: application/json
grant_type=refresh_token
&
refresh_token={{custom_fields.user_refresh_token}}
POST
https://{{custom_fields.domain}}/ccx/oauth2/{{custom_fields.tenant}}/token
content-type: application/x-www-form-urlencoded
accept: application/json
grant_type=refresh_token
&
refresh_token={{oauth.refresh_token}}