Contentful logo

Contentful Community

Receiving nested JSON from Content Delivery API

Hey all,

I need some help figuring out how to receive nested JSON data based on links between content types. Currently, I get the main object plus an includes list that’s flat. I’m trying to get something like this:

mainObject: {
    title: "whatever",
    items: [{
        "itemTitle": "something else"
    }, 
    ....
    ]
}

Where mainObject belongs to some content type that has one-to-many links to another content type (each item inside items). Is something like this at all possible on the Content Delivery API?

1 Like

It seems like you have to do it as text instead of an actual json object sadly.