i used the following function and trying to run HTTP request from postman using curl but didn’t work
exports.handler = function(context, event, callback) {
const client = context.getTwilioClient();
const new_fallback_url = 'http://your_twilio_function_url.com/webhooks/twilio_voice_fallback'; // Replace with your actual Twilio Function URL
// Fetch all phone numbers and update them
client.incomingPhoneNumbers.list()
.then(phoneNumbers => {
const updates = phoneNumbers.map(number => {
return client.incomingPhoneNumbers(number.sid)
.update({ voiceFallbackUrl: new_fallback_url });
});
return Promise.all(updates);
})
.then(results => {
callback(null, `Fallback URL updated for ${results.length} numbers`);
})
.catch(error => {
callback(error);
});
};
I want after running the code all my twilio number will automatically updated
2
Answers
Done thank you i found the solution
Please attach the output of your postman/ cURL request so others can see what the actual error/issue is. Other than that there are a couple things to keep in mind.