I am wondering for a restful API, which of the following would be more practical?
I am just confused when we should pass parameter in the URL Param vs. the Path.
Params are used to filtering a query:
http://www.acme.com/products/?filter=cats&sort=des
And path are used to get an element:
http://www.acme.com/products/1234
So, I recommend you to use myapi.com/users/{userid}
.
Jump to slide 60 from this great presentation (that I recommend you to read).