I am trying to model APIs for
- Create shipments
- Fetch Available shipments (based on region preferences)
- Accept shipments (allows logged in user to accept multiple shipments on first come first serve basis )
- Allocate shipments (allows logged in user to allocate multiple shipments to driver, shipments must be accepted first)
What would the intuitive options for RESTFul API design for below scenarios? Does adding mine or my add any value or it is implicit that call is executed in the context of authenticated user?
Loading shipments This is straightforward by designing POST \shipments\
Available shipments
Option 1: \my\shipments
Option 2: \availableshipments
Option 3: \shipments?available=yes
Accept shipments
Option 1: \my\shipments\acceptance
Option 2: \acceptedshipments
Option 3: \shipments\acceptance
Verb: PUT
Body
"id":
[
"10000023", "10000025", "10000025"
]
Allocate shipments
Option 1: \allocatedshipments
Option 2: \shipments\allocated
Verb: PUT
Body
"driverid": "12312",
"id" :
[
"10000023", "10000025", "10000025"
]