//native
type Codat = {
encodedKey: string
}
/**
* Get data integrity status
* The *Get data integrity status* endpoint returns the [status](https://docs.
*/
export async function main(
auth: Codat,
companyId: string,
dataType: 'banking-accounts' | 'banking-transactions' | 'bankAccounts' | 'accountTransactions'
) {
const url = new URL(
`https://api.codat.io/data/companies/${companyId}/assess/dataTypes/${dataType}/dataIntegrity/status`
)
const response = await fetch(url, {
method: 'GET',
headers: {
Authorization: `Basic ${auth.encodedKey}`
},
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