Edits history of script submission #9118 for ' Search Subscriber (acumbamail)'

  • nativets
    One script reply has been approved by the moderators
    Ap­pro­ved
    type Acumbamail = {
    	authToken: string
    }
    
    export async function main(resource: Acumbamail, subscriber_email: string) {
    	const queryParams = new URLSearchParams({
    		auth_token: resource.authToken,
    		subscriber: subscriber_email
    	})
    
    	const endpoint = `https://acumbamail.com/api/1/searchSubscriber?${queryParams}`
    
    	const response = await fetch(endpoint, {
    		method: 'GET',
    		headers: {
    			'Cache-Control': 'no-cache'
    		}
    	})
    
    	if (!response.ok) {
    		throw new Error(`HTTP error! status: ${response.status}`)
    	}
    
    	const data = await response.json()
    
    	return data
    }
    

    Submitted by hugo697 591 days ago