//native
type Telnyx = {
apiKey: string
}
/**
* Activate every number in a porting order asynchronously.
* Activate each number in a porting order asynchronously. This operation is limited to US FastPort orders only.
*/
export async function main(auth: Telnyx, id: string) {
const url = new URL(`https://api.telnyx.com/v2/porting_orders/${id}/actions/activate`)
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