0

Is the following a good rest design practice for listing all the subscriptions of a customer:

[BaseUrl]/subscriptions/[accountid]/payTV
[BaseUrl]/subscriptions/[accountid]/paywall
etc...

ORshould it rather be:

[BaseUrl]/subscriptions/payTV?[accountID]
[BaseUrl]/subscriptions/paywall?[accountID]
etc...

OR something else?

Nicholas Shanks
  • 10,623
  • 4
  • 56
  • 80
user594883
  • 1,329
  • 2
  • 17
  • 36

1 Answers1

4

Assuming that accountid is the unique id for a customer and payTV/paywall are subscription types, I would choose something like the following:

[BaseUrl]/customers/[accountid]/subscriptions?type=payTV
[BaseUrl]/customers/[accountid]/subscriptions?type=paywall
Jon Susiak
  • 4,948
  • 1
  • 30
  • 38
  • 1
    Further to this, if the only thing you can filter a subscription on is `type`, you can just leave off the query string and use `/customers/[accountid]/subscriptions/paywall` – Nicholas Shanks Mar 06 '13 at 10:21