import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
uspacy: {
type: "app",
app: "uspacy",
}
},
async run({steps, $}) {
return await axios($, {
url: `${this.uspacy.$auth.domain}/company/v1/users/me`,
headers: {
Authorization: `Bearer ${this.uspacy.$auth.oauth_access_token}`,
},
})
},
})
Uspacy uses OAuth authentication. When you connect your Uspacy account, Pipedream will open a popup window where you can sign into Uspacy and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any Uspacy API.
Pipedream requests the following authorization scopes when you connect your account:
POST
{{custom_fields.domain}}/auth/v1/auth/sign_in
accept: application/json
email={{custom_fields.email}}
&
password={{custom_fields.password}}
POST
{{custom_fields.domain}}/auth/v1/auth/refresh_token