//native
/**
* Get a list of tabular fields
* This endpoint can help discover table fields available in your BambooHR account.
*/
export async function main(auth: RT.BambooHr, AcceptHeaderParameter?: string) {
const url = new URL(`https://${auth.companyDomain}.bamboohr.com/api/v1/meta/tables`)
const response = await fetch(url, {
method: 'GET',
headers: {
...(AcceptHeaderParameter ? { AcceptHeaderParameter: AcceptHeaderParameter } : {}),
Authorization: 'Basic ' + btoa(`${auth.apiKey}:x`)
},
body: undefined
})
if (!response.ok) {
const text = await response.text()
throw new Error(`${response.status} ${text}`)
}
return await response.json()
}
Submitted by hugo697 235 days ago