multiple hierarchical objects

81 views
Skip to first unread message

janet smith

unread,
Apr 26, 2012, 1:07:39 AM4/26/12
to api-...@googlegroups.com
Hi guys, 

let's say I have 2 different hierarchical tree.
1. items (group) - item
2. there are report, configration for each item

should I make my api like this:
items/report (summarized report)
item-2/report (individual report)
or
report/items
report/item-3

Your feedback is appreciated.

sune jakobsson

unread,
Apr 26, 2012, 1:54:21 AM4/26/12
to api-...@googlegroups.com
Slightly moor details please :), wit this limited info I would choose your latter suggestion.

Sune

JJ Keys

unread,
May 18, 2012, 7:41:59 AM5/18/12
to api-...@googlegroups.com
Hi Janet,

With the Item Report you could have it two ways

/items/{item_id}/report
*and/or*
/reports/item-reports/{item_id} 

and for the Item Summary Report

/reports/item-summary-report

You want to avoid things like: /items/reports for the summary report because you would normally expect the id of an individual item (e.g /items/item-9) to come after the /items/.. part of the url.

Cheers
JJ

Per Persson

unread,
May 21, 2012, 9:24:05 AM5/21/12
to api-...@googlegroups.com
Here a report can be created for a single item or for all items. What if you want to create a report for a selection of items?
Maybe a report shouldn't be a resource but just generated by an extra parameter (or even a content type)?
Reply all
Reply to author
Forward
0 new messages