REST using hierarchy

Shraga Lolo asked on April 12, 2015 12:51

Hi,

I have configured the REST service and it works.

I have the following hierarchy in the site tree:

  • Story 1
    • page 1
    • col 1
    • col 2
    • page 2
    • col 1
    • col 2
    • page 3

I would like the REST to return hierarchical json but its not working.

I tired using: hierarchy (If true, the response data is exported in a hierarchical structure (if false, the children – bindings – parent structure is flat). To export the data in a hierarchical structure, append ?hierarchy=true to the request URL.), this did NOT have any affect on the json.

I need the json to return the hierarchy from site tree. something like this:

    name: "story 1",
          page 1: {
                col 1: "",
                col 2: ""
            }

Thanks :)

Recent Answers


Jim Spillane answered on April 12, 2015 14:58

The hierarchy parameter is supported when returning Object data rather than Page data. See Data loading parameters

0 votesVote for this answer Mark as a Correct answer

Shraga Lolo answered on April 12, 2015 19:03

Thanks for the reply.

this is what I am currently using: /rest/content/currentsite/en-us/all/story-1?format=json&classnames=aCustom.Station&columns=name,lat,lng,hits

If the objects I want to retrieve at really page that look like this:

Story 1

page 1
    col 1
    col 2
page 2
    col 1
    col 2
page 3

How would I use REST to get the object hierarchy? in the example above each level is a different page type.

Thanks

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.