0
Delete Subscriber List
One script reply has been approved by the moderators Verified

Deletes an existing subscriber list.

Created by hugo697 5 days ago Viewed 1 times
0
Submitted by hugo697 Typescript (fetch-only)
Verified 5 days ago
1
type Acumbamail = {
2
	authToken: string
3
}
4

5
export async function main(resource: Acumbamail, list_id: number) {
6
	const endpoint = 'https://acumbamail.com/api/1/deleteList/'
7

8
	const formData = new FormData()
9
	
10
	formData.append('auth_token', resource.authToken)
11
	formData.append('list_id', list_id.toString())
12

13
	const response = await fetch(endpoint, {
14
		method: 'POST',
15
		headers: {
16
			'Cache-Control': 'no-cache'
17
		},
18
		body: formData
19
	})
20

21
	if (!response.ok) {
22
		throw new Error(`HTTP error! status: ${response.status}`)
23
	}
24

25
	return { success: true }
26
}
27