import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
jumpcloud: {
type: "app",
app: "jumpcloud",
}
},
async run({steps, $}) {
const now = new Date();
const tenDaysBefore = new Date(now.getTime() - (10 * 24 * 60 * 60 * 1000));
const startTime = tenDaysBefore.toISOString();
const data = {"service": ["all"], "start_time": startTime }
return await axios($, {
method: "post",
url: `https://api.jumpcloud.com/insights/directory/v1/events`,
headers: {
"content-type": `application/json`,
"x-api-key": `${this.jumpcloud.$auth.api_key}`,
},
data,
})
},
})
JumpCloud uses API keys for authentication. When you connect your JumpCloud account, Pipedream securely stores the keys so you can easily authenticate to JumpCloud APIs in both code and no-code steps.