# API Endpoint "Return Data from API" as XML instead of plain text

**URL:** <https://forum.bubble.io/t/api-endpoint-return-data-from-api-as-xml-instead-of-plain-text/83812>\
**Category:** APIs\
**Created:** [March 29, 2020, 3:36am UTC](https://forum.bubble.io/t/api-endpoint-return-data-from-api-as-xml-instead-of-plain-text/83812 "2020-03-29T03:36:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![stevie.brodsky](https://avatars.discourse-cdn.com/v4/letter/s/4af34b/32.png) [@stevie.brodsky](https://forum.bubble.io/u/stevie.brodsky)\
**Post date:** [March 29, 2020, 3:36am UTC](https://forum.bubble.io/t/api-endpoint-return-data-from-api-as-xml-instead-of-plain-text/83812/1 "2020-03-29T03:36:30Z")

</div>

I am building out Twilio functionality into my app and working on forwarding calls. To do this I have setup a an api endpoint that gets called whenever a call comes into my twilio number, twilio contacts my webhook and I need to use the “return data from API” action to return some xml instructions to Twilio.

Is it possible to set the data returned as xml? As you can see from the screenshot below I have tried just using the plain text, but the way it is set now twilio does not recognize it as an xml document. I assume I would need access to the headers being sent? Is this possible in bubble?

 ![twilio_error](https://us1.discourse-cdn.com/bubble/original/3X/8/d/8d8492d3436cc1c1f96b8a2cc8d6c0d6a545a573.png)

---

<div class="post-metadata">

**Author:** ![aj11](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/aj11/32/118613_2.png) [@aj11](https://forum.bubble.io/u/aj11)\
**Post date:** [May 27, 2021, 7:48pm UTC](https://forum.bubble.io/t/api-endpoint-return-data-from-api-as-xml-instead-of-plain-text/83812/2 "2021-05-27T19:48:58Z")

</div>

Did you ever find a solution to this?

---

<div class="post-metadata">

**Author:** ![techspot](https://avatars.discourse-cdn.com/v4/letter/t/46a35a/32.png) [@techspot](https://forum.bubble.io/u/techspot)\
**Post date:** [June 1, 2021, 6:04am UTC](https://forum.bubble.io/t/api-endpoint-return-data-from-api-as-xml-instead-of-plain-text/83812/3 "2021-06-01T06:04:32Z")

</div>

Yep! I have something ready to be shared about it. I needed to set up SignalWire Inbound Messaging and they require a XML response so I returned xml data with the xml header as shown in the attached photo.

 ![image](https://us1.discourse-cdn.com/bubble/original/3X/3/7/371db63c2e99a13b82017116944534f5acf11523.png)

---

<div class="post-metadata">

**Author:** ![grace.hong](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/grace.hong/32/109318_2.png) [@grace.hong](https://forum.bubble.io/u/grace.hong)\
**Post date:** [April 18, 2023, 7:57pm UTC](https://forum.bubble.io/t/api-endpoint-return-data-from-api-as-xml-instead-of-plain-text/83812/4 "2023-04-18T19:57:13Z")

</div>

Hey everyone! Just shipped the ability to specify a custom content-type on the “Return data from API” action. Learn more: [Allowing custom content-types on “Return data from API”](http://forum.bubble.io/t/allowing-custom-content-types-on-return-data-from-api/258285)
