//native
/**
* Get termination
* This API allows clients and employees with viewer permissions to retrieve termination data. It ensures that only authorized users can access sensitive information related to terminations.
**Token scopes**: `contracts:read`
*/
export async function main(auth: RT.Deel, oid: string, terminationId: string) {
const url = new URL(`https://api.letsdeel.com/rest/v2/eor/${oid}/terminations/${terminationId}`)
const response = await fetch(url, {
method: 'GET',
headers: {
Authorization: 'Bearer ' + auth.apiKey
},
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