import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
paylocity: {
type: "app",
app: "paylocity",
}
},
async run({steps, $}) {
return await axios($, {
url: `${this.paylocity.$auth.api_url}/api/v2/companies/1PIPEDRM1/employees`,
headers: {
Authorization: `Bearer ${this.paylocity.$auth.oauth_access_token}`,
},
})
},
})
Paylocity uses OAuth authentication. When you connect your Paylocity account, Pipedream will open a popup window where you can sign into Paylocity and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any Paylocity API.
Pipedream requests the following authorization scopes when you connect your account:
WebLinkAPI
POST
{{custom_fields.api_url}}/IdentityServer/connect/token
content-type: application/x-www-form-urlencoded
accept: application/json
client_id={{custom_fields.client_id}}
&
client_secret={{custom_fields.client_secret}}
&
grant_type=client_credentials
&
scope={{oauth.space_separated_scopes}}
POST
{{custom_fields.api_url}}/IdentityServer/connect/token
content-type: application/x-www-form-urlencoded
accept: application/json
client_id={{custom_fields.client_id}}
&
client_secret={{custom_fields.client_secret}}
&
grant_type=client_credentials
&
scope={{oauth.space_separated_scopes}}