Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Rest Endpoint Constrruction  RSS feed

 
Prabhash Mishra
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
    Previously i design a endpoint for getting history of orders associated with particular customerid.My Url is:

http://localhost:7001/OrderHistoryIntegration/orderapi/ordersHistory/610809952

Now I am adding filtering option to the existing endpoint like user can get their order history associated with customerid by specifying start date and end date.My Url is:

http://localhost:8088/OrderHistoryIntegration/orderapi/ordersHistory/610809952?start=30/08/2016&end=30/08/2017

Can anybody tell me that the Url is ok as per standers or i have to make it more meaningful.This Url is working fine i just want to confirm it is meaningful.i can't change previous url as it is on QA and performance so initial part is fix i need to add query string after that.

Thanks,
Prabhash
 
Stephan van Hulst
Saloon Keeper
Posts: 7713
141
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would use ISO date notations instead. Otherwise it looks fine, although if you used REST sub-resources it would probably look something like this:

/orderapi/customers/610809952/orders/?start=2016-08-30&end=2017-08-30
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!