JSON vs. XML
We currently support 2 language transport options within the API; JSON and XML. You are free to use whichever suits your needs best, they are both first class citizens.
Why use JSON?
You should choose JSON if you intend to work with JSON compatible code libraries.
Why use XML?
Did you know?
The API uses XML schema validations on all received data, even if you use JSON!
Schema validation forms part of our 3 stage validation process; schema, logical and data integrity.
XML is a more heavyweight transport medium but allows for data schema restrictions and validations.
You should choose XML when using code libraries designed to consume XML and when you plan to perform schema validations prior to data transmission.
Using XML and JSON
Please Note: If you omit the content-type or accept headers, the API defaults to XML.
You can control the data type used by specifing HTML headers in your requests. It is entirely posible to transmit in one language and receive in the other.
HTTP Header: Content-Type
Use the "Content-Type" header to tell the API which transmission data type you are using.
- content-type: application/json
- content-type: application/xml
HTTP Header: Accept
Use the "Accept" header to tell the API which response data type you require.
- accept: application/json
- accept: application/xml