//native
type Telnyx = {
apiKey: string
}
/**
* Refresh the status of all Upload requests
* Forces a recheck of the status of all pending Upload requests for the given external connection in the background.
*/
export async function main(auth: Telnyx, id: string) {
const url = new URL(`https://api.telnyx.com/v2/external_connections/${id}/uploads/refresh`)
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 428 days ago