Welcome to the Alteryx Knowledge Base
How to Change the API response to XML or JSON Format?
Created/Edited -
How To
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
Environment
- Alteryx Designer, Server (enter product name as appropriate)
- Version(s) (If applicable).
- Third Party products (e.g., Salesforce, Tableau, SQL Server)
- Version(s) (If applicable).
- Additional Tools (e.g., Publish to Tableau Server tool, provide an embedded link to download/download instructions) (if applicable).
- Additional required assets (API Keys, Permissions, etc.) (if applicable).
- Drivers (if applicable).
- List of other symptoms
- Additional Behaviors
- Show All Macro Messages Additional Information/Messages (Specifically Macro tools/R tools)
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:
Example in Alteryx API documentation/Swagger:
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 Information
Was this article helpful?