Create your own feed for FUSE: JSON and XML Code Examples

<< Go Back to the Technology FAQs Page

Overview

Watch out for extra nodes! A node should be just an array of objects, not an array of objects each of which contains a single node object since it’s redundant and doesn't play nicely.

Also, it's much better to have keys missing or with null value rather than ““ values. It saves space in transmission and it will be more clear: "there is no value" rather than "there is a value and it is an empty text." The latter will screw up facets (i.e. filters).


JSON Example

{
    "some_structure":{
        "a_collection":[
            {
                "link":"http://...",
                "title":"My Title",
                "other":"Long or short text here",
                "last_updated":"2016-01-01T12:25"
            },
            {
                "link":"http://...",
                "title":"My Title",
                "other":"Long or short text here",
                "last_updated":"2016-01-01T12:25"
            }
        ]
    }
}

XML Example

<SomeTag>
    <CollectionHere>
        <Item>
            <Link>http://...</Link>
            <Title>My Title</Title>
            <OtherTag>Long or Short Text Here</OtherTag>
            <LastUpdated>2016-01-01T12:25</LastUpdated>
        </Item>
        <Item>
            <Link>http://...</Link>
            <Title>My Title</Title>
            <OtherTag>Long or Short Text Here</OtherTag>
            <LastUpdated>2016-01-01T12:25</LastUpdated>
        </Item>
    </CollectionHere>
</SomeTag>