What is JSON?

JSON (JavaScript Object Notation) is a lightweight data-interchange format. Unlike XML where complex schemas are required to structure data, with JSON you simply have an object that just contains the data with their field name. Here is an example of JSON:

{
     success: true,
     errors: [ ],
     message_id: 600969775,
     message: "SMS Successfully Queued",
     remainingCredits: 915
}

The same string in XML could look like this:

    <?xml version="1.0" encoding="UTF-8" ?>
    <success>true</success>
    <message_id>600969775</message_id>
    <message>SMS Successfully Queued</message>
    <remainingCredits>915</remainingCredits>

XML supports various other extras that could end up making the file containing the data much bigger. In this specific case the size difference isn't that much, but this can become much more noticeable if the data becomes more. That is why JSON is a bit more lightweight.