// native
type Zixflow = {
apiKey: string
}
export async function main(
resource: Zixflow,
body: {
iconType: string
iconValue: string
name: string
status: string
scheduleAt: string
description?: string
associated?: string
}
) {
const endpoint = `https://api.zixflow.com/api/v1/collection-records/activity-list`
const response = await fetch(endpoint, {
method: 'POST',
headers: {
Authorization: `Bearer ${resource.apiKey}`,
'Content-Type': 'application/json'
},
body: JSON.stringify(body)
})
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`)
}
const data = await response.json()
return data
}
Submitted by hugo697 606 days ago