Sign up ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free.

I'm creating a RESTfull service for a tree-like resource structure and was wondering what the best URL structure would be?

I have three requirements:

  1. be able to get a collection of root resources
  2. be able to get an individual resource
  3. be able to get a collection of child resources

My current thought is:


I was also thinking of going the singular / plural routes to denote lists or individual elements, but I know I'm going to have a resource that is the same plural as it is singular, so decided against this.

Does anybody have any thoughts on the above? or have a different / better way of structuring this?

Many thanks


share|improve this question
I may be misunderstanding the question but as we're talking about urls is SEO an issue? –  Jon Hopkins Dec 2 '10 at 11:21
SEO is not an issue, no. I'm basically asking the best logical URL structure for a self referencing resource. –  Matt Brailsford Dec 2 '10 at 11:32
That seems pretty straight forward to me. –  Tim Post Dec 2 '10 at 11:43
How deep can that structure go? –  Martijn Verburg Dec 2 '10 at 13:09
@Martijn the depth is un-restricted –  Matt Brailsford Dec 17 '10 at 12:19

1 Answer 1

Something like this perhaps:


where {rootEntity} is the starting point of your collection, {leafEntity} is any named leaf node within your tree.

You could append a few parameters any of the above to select, say, Latest or All or something.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.