0

If I want to get projects for userid= 1 then my url looks like

https://localhost:8080/proj_name/api/user/1/projects

How should I construct my resource path if I want to get projects not associated with a particular user id? Any suggestions? Should it be like this or something else?

https://localhost:8080/proj_name/api/projects?excludeUserId = 1
Karu
  • 935
  • 2
  • 13
  • 32

2 Answers2

0

You could use ne operator of rql (resource query language).

Sarah Micallef
  • 422
  • 4
  • 7
0

I went ahead and referred this post How can I pass complex objects as arguments to a RESTful service?

I used option 2 from the answer posted on the above stackoverflow post and ended up having urls like

https://localhost:8080/proj_name/api/projects
https://localhost:8080/proj_name/api/projects?filter={"equalUserId":"1"}
https://localhost:8080/proj_name/api/projects?filter={"notEqualUserId":"1"}
Karu
  • 935
  • 2
  • 13
  • 32