//native
/**
* Get all countries
* Get all available countries as options. Returns a list of countries with ID and name for use in forms and dropdowns.
*/
export async function main(auth: RT.BambooHr) {
const url = new URL(`https://${auth.companyDomain}.bamboohr.com/api/v1/meta/countries/options`)
const response = await fetch(url, {
method: 'GET',
headers: {
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