Thursday, September 28, 2017

ASP.NET Web Api, Twilio Web Hook and Error - 12300 Invalid Content Type

When using Twilio web hook implemented in ASP.NET Web Api, you may get this error

12300 Invalid Content Type

The following page TWIML MESSAGE: YOUR RESPONSE, lead me to the right way to implement the web hook.

public HttpResponseMessage SmsAnswerCallBack(string id)
    var res     = Request.CreateResponse(HttpStatusCode.OK);
    res.Content = new StringContent("<Response/>", Encoding.UTF8, "text/xml");
    return res;

No comments:

Post a Comment