Single endpoint to fetch lists of investigations
Currently, the following endpoints allow fetching multiple investigations from the data catalogue:
-
/catalogue/{sessionId}/investigation
- Get investigations by sessionId => "My Data" page -
/catalogue/{sessionId}/investigation/useris/instrumentscientist/investigation
- Gets all investigations where I am instrument scientist => manager menu and beamline pages -
/catalogue/{sessionId}/investigation/status/embargoed/investigation
- Gets all investigations that are under embargo => "Closed Data" page -
/catalogue/{sessionId}/investigation/status/released/investigation
- Gets all investigations which content is public => "Open Data" page > "Open investigations" table
In the front-end, with Rest Hooks, we would benefit from having a single endpoint to cover all of these.
Here is specification I suggest for this all-in-one endpoint:
GET /catalogue/{sessionId}/investigation
- no params - get investigations of which the user is a participant
-
?instrument=<instrument-id>
- get investigations for a particular instrument- 400 if the instrument ID is empty
- 404 if the instrument ID does not match any known instrument
-
?status=[released|embargoed]
- get investigations in the given status- 400 if the status is not one of the above
- 403 if the user is not allowed to access investigations in this status (not exactly sure what the specific rules are here)
- 400 if no parameter or an unknown parameter is passed
Note that the suggested specification does not support fetching investigations for all or multiple instruments at once, as I don't think this will be needed in the front-end. We could allow passing multiple instrument IDs, but I don't think it's worth the effort.
Edited by Axel Bocciarelli