Early bird tickets for Inspire 2023 are now available! Discounted pricing closes on January 31st. Save your spot!

Alteryx Server Knowledge Base

Definitive answers from Server experts.

How to Change the API response to XML or JSON Format?

clarab
Alteryx
Alteryx
Created

How to Change the API response to XML or JSON Format?


This article provides instructions on how you can change the format of Server API response. The available formats are:
  • application/json
  • application/xml
  • text/json
  • text/xml
 

Prerequisites

 
  • Alteryx Server
    • Version: All
  • Alteryx Server API
    • Versions: < v3

Procedure

 
In the API service, include "Accept" in the  HTTP request header and set it to:
  • For JSON, choose either one of the following:
    • application/json
    • text/json
  • For XML, choose either one of the following:
    • application/xml
    • text/xml

Example in Java code:
 
...
request.addHeader(“Accept", “application/json”);
...

Example in Postman:

image.pngimage.png

Example in Alteryx API documentation/Swagger:

image.pngimage.png
 
 
Spoilers
Changing the content type for API version 3 does not work. It will either throw an error or there is no effect. TGAL-6745 has been logged to address this.

 
 

Additional Resources