//native
/**
* User Login
* User Login
*/
export async function main(auth: RT.BambooHr, body: Login, AcceptHeaderParameter?: string) {
const url = new URL(`https://${auth.companyDomain}.bamboohr.com/api/v1/login`)
const response = await fetch(url, {
method: 'POST',
headers: {
...(AcceptHeaderParameter ? { AcceptHeaderParameter: AcceptHeaderParameter } : {}),
'Content-Type': 'application/x-www-form-urlencoded',
Authorization: 'Basic ' + btoa(`${auth.apiKey}:x`)
},
body: new URLSearchParams(body as Record<string, string>)
})
if (!response.ok) {
const text = await response.text()
throw new Error(`${response.status} ${text}`)
}
return await response.json()
}
/* eslint-disable */
/**
* This file was automatically generated by json-schema-to-typescript.
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
* and run json-schema-to-typescript to regenerate this file.
*/
export interface Login {
applicationKey?: string
user?: string
password?: string
[k: string]: unknown
}
Submitted by hugo697 137 days ago