Edits history of script submission #20955 for ' Duplicate Company List (their_stack)'

  • bun
    One script reply has been approved by the moderators
    Ap­pro­ved
    //native
    type TheirStack = {
    	apiKey: string
    }
    /**
     * Duplicate Company List
     *
     */
    export async function main(auth: TheirStack, list_id: string) {
    	const url = new URL(`https://api.theirstack.com/v0/company_lists/${list_id}/duplicate`)
    
    	const response = await fetch(url, {
    		method: 'POST',
    		headers: {
    			Authorization: 'Bearer ' + auth.apiKey
    		},
    		body: undefined
    	})
    	if (!response.ok) {
    		const text = await response.text()
    		throw new Error(`${response.status} ${text}`)
    	}
    	return await response.json()
    }
    

    Submitted by hugo697 235 days ago