Data Conversion · REST API

JSON to XML & XML to JSON API

Convert structured JSON into XML and parse XML documents into JSON through two dedicated REST endpoints.

Free tier available. Both endpoints require a JWT Bearer Token.

Conversion capabilities

Nested structures

Convert nested objects, arrays and primitive values while preserving document hierarchy.

Attributes and text nodes

Represent XML attributes with @attribute and text nodes with #text.

Configurable output

Choose XML array layout, stabilize repeated elements as JSON arrays and optionally strip namespace prefixes.

Convert JSON to XML

Send a valid JSON object or array. A single top-level property becomes the XML root; multiple properties or a top-level array generate a synthetic root element.

Endpoint

POST /api/v1/convert/data/json-to-xml

Input: application/json · Output: application/xml

Short example

Input

{
  "book": {
    "@category": "learning",
    "title": "Learning XML",
    "author": "Team DevHub"
  }
}
						

Output

<book category="learning">
  <title>Learning XML</title>
  <author>Team DevHub</author>
</book>
						

Conversion options

Optional JSON to XML query parameters
Parameter Default Description
arrayMode FLAT FLAT repeats the element name; WRAPPED creates a parent with item children.
JSON to XML in Swagger

Convert XML to JSON

Send a well-formed XML document as raw text. The root element is retained as the top-level JSON key; repeated sibling elements become arrays.

Endpoint

POST /api/v1/convert/data/xml-to-json

Input: text/plain · Output: application/json

Short example

Input

<book category="learning">
  <title>Learning XML</title>
  <author>Team DevHub</author>
</book>
						

Output

{
  "book": {
    "@category": "learning",
    "title": "Learning XML",
    "author": "Team DevHub"
  }
}
						

Conversion options

Optional XML to JSON query parameters
Parameter Default Description
forceArray false Stabilize potentially repeated elements as JSON arrays, even when one occurrence is present; singular elements remain unchanged.
stripNamespaces false Remove namespace prefixes from element and attribute names, discarding namespace URI information.
XML to JSON in Swagger

When to use these APIs

Integrate XML-based systems

Transform JSON application data into XML for legacy integrations and XML-driven workflows.

Modernize XML payloads

Convert XML responses into structured JSON for REST applications, SDKs and frontend processing.

Explore more DevHub APIs

Browse the API catalog or consult interactive documentation for request and response details.

loader