2

For example let's say I have a url like /projects/{projectId}/progress.

Now, lets say a user can only be in one project. if the server already knows which project the user belongs to based on the context, do we need to pass the projectId or can we put the url as /projects/current/progress since we wouldn't be using the projectId even if it is passed.

Just want to know if it is a good practice or not.

Venkata Jaswanth
  • 1,661
  • 2
  • 11
  • 12

1 Answers1

3

A resource can have multiple identifiers and nothing stops you from using a static mapping such as /projects/{projectId}/progress and a mapping that depends on a context such as /projects/current/progress.

A similar topic has been discussed here, here and here.

cassiomolin
  • 124,154
  • 35
  • 280
  • 359