185
Views
1
Comments
Exposing API Webhook for Twilio
Question

Hi,

I am trying to expose an API for the Twilio webhook functionality.

On the Twilio debugger I get an error message: unsupported media type with a body response:

{
    "Errors": [
        "The request entity's media type 'application/x-www-form-urlencoded' is not supported for this resource."
    ],
    "StatusCode": 415
}


I believe the content-type needs to be application/json coming in from Twilio but I am not sure how to change that.


Any help would be much appreciated!

2025-10-21 13-42-45
Alexandre Costa

Justin Sirpilla wrote:

Hi,

I am trying to expose an API for the Twilio webhook functionality.

On the Twilio debugger I get an error message: unsupported media type with a body response:

{
    "Errors": [
        "The request entity's media type 'application/x-www-form-urlencoded' is not supported for this resource."
    ],
    "StatusCode": 415
}


I believe the content-type needs to be application/json coming in from Twilio but I am not sure how to change that.


Any help would be much appreciated!

Hello Justin, by default Twillio's REST API return XML, with a root element of <TwillioResponse>. Twillio also supports returning resource represantation as JSON. Simply add the .json extension to any resource URI.


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.