//native
/**
* Get details of a child organization
* Retrieves a specific child organization by its id. If the organization does not belong to the enterprise, a 404 error is returned.
*/
export async function main(auth: RT.Mezmo, accountId: string) {
const url = new URL(`https://api.mezmo.com/v1/enterprise/account/${accountId}`)
const response = await fetch(url, {
method: 'GET',
headers: {
Authorization: 'Token ' + 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