type Certopus = {
apiKey: string
}
export async function main(resource: Certopus, organisationId: string) {
const endpoint = `https://api.certopus.com/v1/events/${organisationId}`
const response = await fetch(endpoint, {
method: 'GET',
headers: {
accept: 'application/json',
'x-api-key': resource.apiKey
}
})
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`)
}
const data = await response.json()
return data
}
Submitted by hugo697 86 days ago