Home RESTfully get multiple resources using ids of parent resource
Reply: 0

RESTfully get multiple resources using ids of parent resource

darksmurf
1#
darksmurf Published in 2018-01-12 14:05:58Z

I have 2 resources relating to each other in the following way

Parent --* Kid

I can access Kids by for instance

/kids
/kids/1
/kids?ids=1,2,3
/parents/1/kids

But how do I access all Kids that have the same Parent for multiple Parents? E.g. getting all Kids for Parents 1, 2 and 3?

  • I want to do this in batch (not calling /parents/{id}/kids multiple times
  • I want to do it in a RESTful way (I realize this can be solved in an infinite number of unRESTful ways)

Is it RESTfully corrent to do this:

/parents/1,2,3/kids

Or this:

/parents/1/kids?parentIds=1,2,3
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.311652 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO