with Rize and ServiceTitan?
import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
rize: {
type: "app",
app: "rize",
}
},
async run({steps, $}) {
const data = {
"query": `query CurrentUser {
currentUser {
email
}
}`,
}
return await axios($, {
method: "post",
url: `https://api.rize.io/api/v1/graphql`,
headers: {
Authorization: `Bearer ${this.rize.$auth.api_key}`,
},
data,
})
},
})
import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
servicetitan: {
type: "app",
app: "servicetitan",
}
},
async run({steps, $}) {
return await axios($, {
url: `https://api${this.servicetitan.$auth.environment}servicetitan.io/settings/v2/tenant/${this.servicetitan.$auth.tenant_id}/employees`,
headers: {
Authorization: `Bearer ${this.servicetitan.$auth.oauth_access_token}`,
"st-app-key": `${this.servicetitan.$auth.client_id}`,
},
})
},
})