Can a resource exist only through a collection ?

40 views
Skip to first unread message

Simon Renoult

unread,
Oct 7, 2016, 11:04:02 AM10/7/16
to API Craft
Hi,

I'm working on an endpoint where a subresource of this endpoint is a collection that does not allow identification. This is what it looks like :

/products/<id>
/products/<id>/prices 

Since the endpoint /products/<id>/prices returns:

[{ value: 102, currency: 'EUR', expires_at: 1475855928 }, { value: 110, currency: 'EUR', expires_at: 1475859528 }, ...]
 
The endpoint /products/<id>/prices/<id> can't be.

Though my example seems to make sense, is it valid? Is there an rfc somewhere that contradicts this approach?


Thanks for you help !

mca

unread,
Oct 7, 2016, 2:47:29 PM10/7/16
to api-...@googlegroups.com
you have full control over your URL design and there is no IETF standard that sets requirements on what MUSt appear where. what you describe here is just fine -- and quite common.

there is an RFC that offers guidance that you should keep handy, tho:

Cheers.

--
You received this message because you are subscribed to the Google Groups "API Craft" group.
To unsubscribe from this group and stop receiving emails from it, send an email to api-craft+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/api-craft.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages