0

Delete Activity

by
Published Oct 11, 2024

This endpoint allows the deletion of selected activity details.

Script zixflow Verified

The script

Submitted by hugo697 Bun
Verified 606 days ago
1
//native
2

3
type Zixflow = {
4
	apiKey: string
5
}
6

7
export async function main(resource: Zixflow, activityId: string) {
8
	const endpoint = `https://api.zixflow.com/api/v1/collection-records/activity-list/${activityId}`
9

10
	const response = await fetch(endpoint, {
11
		method: 'DELETE',
12
		headers: {
13
			Authorization: `Bearer ${resource.apiKey}`,
14
			'Content-Type': 'application/json'
15
		}
16
	})
17

18
	if (!response.ok) {
19
		throw new Error(`HTTP error! status: ${response.status}`)
20
	}
21

22
	const data = await response.json()
23

24
	return data
25
}
26