I know this question has been answered several times, but I am still not sure that providing GET
with long list of non-structured query parameters or POST
to get data is right approach.
I have provided the endpoint:
GET /businessrelationships/{brGlobalKey}
Which returns one resource/object. I would like to provide GET
endpoint (as this is safe method) to get predefined list of objects. I was thinking to firstly use POST
to create new resource, Lists:
POST /businessrelationships/{brGlobalKey}/lists
with Body : {
"brGlobalKeys": [
1234,
212354,
3748
]
}
The POST
will be idempotent and will return listID
, for example 123xyz
. I would then provide GET
to retrieve list with multiple objects:
GET /businessrelationships/{brGlobalKey}/lists/123xyz
Please let me know is this correct method? I know that using 2 instead of 1 call will affect performances, but it is up to the consumer to decide if they want to GET
single resource several times or to use list.
Thanks