//native
type Telnyx = {
apiKey: string
}
/**
* Delete a conference participant
* Deletes a conference participant
*/
export async function main(
auth: Telnyx,
account_sid: string,
conference_sid: string,
call_sid: string
) {
const url = new URL(
`https://api.telnyx.com/v2/texml/Accounts/${account_sid}/Conferences/${conference_sid}/Participants/${call_sid}`
)
const response = await fetch(url, {
method: 'DELETE',
headers: {
Authorization: 'Bearer ' + auth.apiKey
},
body: undefined
})
if (!response.ok) {
const text = await response.text()
throw new Error(`${response.status} ${text}`)
}
return await response.text()
}
Submitted by hugo697 428 days ago