Edits history of script submission #9114 for ' Delete Subscriber List (acumbamail)'

  • nativets
    One script reply has been approved by the moderators
    Ap­pro­ved
    type Acumbamail = {
    	authToken: string
    }
    
    export async function main(resource: Acumbamail, list_id: number) {
    	const endpoint = 'https://acumbamail.com/api/1/deleteList/'
    
    	const formData = new FormData()
    	
    	formData.append('auth_token', resource.authToken)
    	formData.append('list_id', list_id.toString())
    
    	const response = await fetch(endpoint, {
    		method: 'POST',
    		headers: {
    			'Cache-Control': 'no-cache'
    		},
    		body: formData
    	})
    
    	if (!response.ok) {
    		throw new Error(`HTTP error! status: ${response.status}`)
    	}
    
    	return { success: true }
    }
    

    Submitted by hugo697 591 days ago