//native
type Intercom = {
apiVersion: string
token: string
}
/**
* Cancel content data export
* You can cancel your job
*/
export async function main(auth: Intercom, job_identifier: string) {
const url = new URL(`https://api.intercom.io/export/cancel/${job_identifier}`)
const response = await fetch(url, {
method: 'POST',
headers: {
'Intercom-Version': auth.apiVersion,
Authorization: 'Bearer ' + auth.token
},
body: undefined
})
if (!response.ok) {
const text = await response.text()
throw new Error(`${response.status} ${text}`)
}
return await response.json()
}
Submitted by hugo697 536 days ago