//native
type Telnyx = {
apiKey: string
}
/**
* Request setting a SIM card to standby
* The SIM card will be able to connect to the network once the process to set it to standby has been completed, thus making it possible to consume data.
*/
export async function main(auth: Telnyx, id: string) {
const url = new URL(`https://api.telnyx.com/v2/sim_cards/${id}/actions/set_standby`)
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