//native
type Telnyx = {
apiKey: string
}
/**
* Delete a phone number extension
* Deletes a phone number extension.
*/
export async function main(auth: Telnyx, porting_order_id: string, id: string) {
const url = new URL(
`https://api.telnyx.com/v2/porting_orders/${porting_order_id}/phone_number_extensions/${id}`
)
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.json()
}
Submitted by hugo697 428 days ago