//native
type Telnyx = {
apiKey: string
}
/**
* Request bulk setting SIM card public IPs.
* This API triggers an asynchronous operation to set a public IP for each of the specified SIM cards.
For each SIM Card a SIM Card Action will be generated. The status of the SIM Card Action can be followed through the [List SIM Card Action](https://developersdev.telnyx.com/docs/api/v2/wireless/SIM-Card-Actions#ListSIMCardActions) API.
*/
export async function main(auth: Telnyx, body: { sim_card_ids: string[] }) {
const url = new URL(`https://api.telnyx.com/v2/sim_cards/actions/bulk_set_public_ips`)
const response = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: 'Bearer ' + auth.apiKey
},
body: JSON.stringify(body)
})
if (!response.ok) {
const text = await response.text()
throw new Error(`${response.status} ${text}`)
}
return await response.json()
}
Submitted by hugo697 428 days ago