Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I'm getting error Upgrade Required while integrating twilio whatsapp in c#

This is the error I am getting while trying to send the message.

An unhandled exception of type 'Twilio.Exceptions.ApiException' occurred in Twilio.dll
Additional information: Upgrade Required

My code is:

const string accountSid = "Value";
const string authToken = "Value";
TwilioClient.Init(accountSid, authToken);
var to = new PhoneNumber("+whatsapp:+13233633791");
var message = MessageResource.Create(
    to,
    from: new PhoneNumber("+whatsapp:+12037179461"),
    body: "Hi Joe! Your order D45987AB will arrive on 8/12/2018 before 8 pm.");
    Console.WriteLine(message.Sid);
like image 425
learner Avatar asked Apr 05 '19 05:04

learner


People also ask

How do I integrate WhatsApp into Twilio?

Manage and Configure Your WhatsApp-enabled Twilio Numbers To manage your own templates and your WhatsApp profile, go to Messaging > Senders > WhatsApp Senders in the Console. Here, you can see the list of your WhatsApp-enabled Twilio phone numbers (senders) as well as any templates that you have submitted for approval.

What is Twilio WhatsApp API?

The Twilio API for WhatsApp is the quickest way to add two-way messaging on WhatsApp into your web application. With the same Twilio API you use for SMS, you can easily add WhatsApp capabilities to your application by changing just two lines of code.


1 Answers

Per their docs, Twilio APIs now requires TLS v1.2 and string cipher suites.

Inside your method, before MessageResource.Create() is invoked, add

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls
                                                | SecurityProtocolType.Tls11
                                                | SecurityProtocolType.Tls12
                                                | SecurityProtocolType.Ssl3;
like image 153
SteveSeow Avatar answered Oct 14 '22 03:10

SteveSeow