1

I'm trying to add an SMS Participant to Twilio an existing Twilio conversation using this API fetch. snapshot.node_.value_ is the conversation ID CHXXXXXX... and both phone numbers are actual values in the real code, not just +1XXXXX

fetch(`https://conversations.twilio.com/v1/Conversations/${snapshot.node_.value_}/Participants/`, {
    method: 'POST',
    headers: new Headers({
        "Content-Type": "application/x-www-form-urlencoded",
        'Authorization': 'Basic '+btoa(`${twilioAccountSID}:${twilioAuthToken}`)
    }),
    body: new URLSearchParams({
        "MessagingBinding.Address":"+1XXXXXXXXXX",//Personal phone number
        "MessagingBinging.ProxyAddress":"+1XXXXXXXXXX"//Twilio phone number
    }),
    redirect: 'follow'
})

Unfortunately when I catch and log an error I get {"code": 20403, "message": "403 Forbidden", "more_info": "https://www.twilio.com/docs/errors/20403", "status": 403}

The more info page is pretty unhelpful. I'm currently on a twilio trial account, but nothing in the trial limitations mentions conversations. I am able to use a matching API call successfully when I use Postman.

philnash
  • 70,667
  • 10
  • 60
  • 88
gehrlich
  • 23
  • 5

0 Answers0