I need to design an API endpoint that accepts a list of composite identifiers for a GET request
Lets say an identifier is the composite of these 2 attributes:
- type - int - can have multiple ids associated
- id - int - can belong to multiple types
and lets say a client wants to query for the following items:
- type 10, id 99
- type 10, id 98
- type 11, id 89
- type 12, id 79
What would be a standard way to design this
Some options I've been contemplating
Single query string parameter, with
type:idexpected in an explicit order/endpoint?typeid=10:99&typeid=10:98&typeid=11:89&typeid=12:79
Single query string parameter, with explicitly called out args for each part of the composite
/endpoint?q=type:10+id:99&q=type:10+id:98&q=type:11+id:89&q=type:12+id:79
Same as 2, but comma separated
/endpoint?q=type:10+id:99,type:10+id:98,type:11+id:89,type:12+id:79