---
title: Convert XML to JSON
slug: convert-xml-to-json
docTags: 
createdAt: 2022-12-28T05:34:48.000Z
---

Converts an XML text to JSON.



### API Definition

:::ApiMethodV2
```json
{
  "tab": "examples",
  "url": "https://orca.pathfix.com/functions/json/fromxml",
  "name": "XML to JSON",
  "method": "POST",
  "request": {
    "pathParameters": [],
    "queryParameters": [],
    "headerParameters": [],
    "bodyDataParameters": [],
    "formDataParameters": []
  },
  "results": {
    "languages": [
      {
        "id": "28UsDqyeH3QRdmtVamSQT",
        "code": "{\n    \"output\": {\n        \"document\": {\n            \"record\": [\n                {\n                    \"email\": \"bruce@pathfix.com\",\n                    \"source\": \"facebook\",\n                    \"other\": \"test\",\n                    \"date\": \"2022-01-25\"\n                },\n                {\n                    \"email\": \"paul@pathfix.com\",\n                    \"source\": \"facebook\",\n                    \"date\": \"2022-02-12\"\n                },\n                {\n                    \"email\": \"chang@pathfix.com\",\n                    \"source\": \"linkedin\",\n                    \"date\": \"2022-02-15\"\n                }\n            ]\n        }\n    },\n    \"size_in_bytes\": 602.0\n}",
        "language": "200"
      },
      {
        "id": "yIX64DyIuDPJgBRFSfAWb",
        "code": "{\n    \"message\": \"error\"\n}",
        "language": "404"
      }
    ],
    "selectedLanguageId": "28UsDqyeH3QRdmtVamSQT"
  },
  "examples": {
    "languages": [
      {
        "id": "ENcJz9TStG38F0X-taA4x",
        "code": "{\r\n    \"input\": \"<document><record><email>bruce@pathfix.com</email><source>facebook</source><other>test</other><date>2022-01-25</date></record><record><email>paul@pathfix.com</email><source>facebook</source><date>2022-02-12</date></record><record><email>chang@pathfix.com</email><source>linkedin</source><date>2022-02-15</date></record></document>\"\r\n}",
        "language": "json"
      }
    ],
    "selectedLanguageId": "ENcJz9TStG38F0X-taA4x"
  },
  "description": "\nCall the following API:",
  "currentNewParameter": {
    "label": "Body Parameter",
    "value": "bodyDataParameters"
  }
}
```
:::

















