Hi!
Beginner here. I need to connect one app to my CRM and pull all the data possible so I can pass it to a webhook (via Zapier). However, the results are XML, but the webhook needs them in JSON.
I have scoured here and StackOverflow and found a lot of OK code, but none seems to do what I need to do.
Here’s a sample of the XML:
<?xml version="1.0" encoding="utf-8"?>
<Events>
<Link rel="link">
<Event>
<EventID>1</EventID>
<UniqueIdentifier>6249a570-8484-4f7d-b22d-a55680d7de9b</UniqueIdentifier>
<Code>SKU-001</Code>
<Name>Event Name</Name>
<StartDateTime>2023-06-04T10:00:00.0000000-04:00</StartDateTime>
<FinishDateTime>2023-06-08T15:30:00.0000000-04:00</FinishDateTime>
<StartTimeZoneAbbr>EDT</StartTimeZoneAbbr>
<FinishTimeZoneAbbr>EDT</FinishTimeZoneAbbr>
<LocationName>New York</LocationName>
<IsPrivate>false</IsPrivate>
<Status>Completed</Status>
<CreatedDateTime>2023-03-28T20:03:28.5133495Z</CreatedDateTime>
<LastModifiedDateTime>2023-06-12T14:37:45.9044154Z</LastModifiedDateTime>
<Link rel="self" type="application/xml" href="link"/>
<Link rel="self" type="application/xml" href="link"/>
</Event>
</Link>
And here’s what I can get using xml2json:
Any help on:
- Converting this XML to JSON
- Passing all of it to a POST request also in Postman
Would be much appreciated.
Thanks!