I'm all for exposing the active promotions as their own resource, that embed the promotions that apply to that view.
Doing so minimizes the 'surface area' of your API and frees you to make more changes behind the scenes than a generic filterable resource for all promotions.
-pete
--
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+...@googlegroups.com.
Visit this group at http://groups.google.com/group/api-craft.
For more options, visit https://groups.google.com/d/optout.
Also, i know URLs shouldn't matter too much in a Hypermedia API because i can change the underlying URL and a "good" client should be able to deal, but given I want to keep my URLs "cool" i'm also debating between exposing the collection at /activePromotions vs /promotions/active. Opinions on this are appreciated as well!
Quite right on the ambiguity of active. Its an either or concept. A promotion is active or inactive.
It may be inactive because it expired or isn't available to a country or specific customer be a use of their cart items
It may be inactive because it expired or isn't available to a country or specific customer be a use of their cart items
not trying to be obtuse, but why is it definitely a query?
So i think i'm hearing that addressing the active promotions collection as it's own resource seems reasonable.
Any opinions on the URL structure?/promotions/active/cart/15/promotions/active/products/55/promotions activevs/activePromotions/cart/15/activePromotions/products/55/activePromotions