Relaying requests for other systems
Genesys is a gateway for users to select (based on data in Genesys) and make requests for material (to multiple genebanks). This ticket describes making the existing Genesys request mechanisms and workflows available for use by other systems (e.g. snp-seek.irri.org).
Basic workflow
- User makes the selection of material on Site A (shopping cart on Site A)
- User clicks "Request for material" button on Site A
- Site A sends
requestData
to Genesys - Genesys responds with a request identifier
reqId
- Site A sends
- Site A redirects the user to Genesys website to complete the request for selected material
Step 2 is executed by the server of Site A (not in the browser).
Initiating the Request
Request data sent to Genesys API from the external system includes only the list of selected accessions (preferably by doi
, alternatively with FAO instituteCode
and accessionNumber
). No personally identifiable information is sent in the request.
[
{ "doi": "10.xxxx/1231", "instituteCode": "PHL001", "accessionNumber": "IRGC 1000001" },
{ ... }
]
Genesys may have a limit on the number of items accepted for a single request.
Genesys response
Genesys checks that all requested items exist in the database and that they are flagged as available for distribution.
200 OK response: all items in the list pass the checks, a request record is persisted and waiting for the user to resume the ordering process on the Genesys website.
{
"id": "some-generated-id",
"url": "https://the-url-to-continue-the-order",
// maybe more detail?
}
4xx Client error response: one or more items are not available in Genesys. The request is not persisted.
{
"error": "Error message",
"detail": { // TBD }
}
5xx Server error response: something went horribly wrong, response body contains a standard Genesys API error message in JSON.
Redirecting the user
Site A has the request identifier and the url
that is used to resume the ordering process on the Genesys website. Site A may store this data for further processing.
The user navigates to the url
provided in the Genesys response either using an HTTP redirect or a regular link. Upon accessing the url
, Genesys checks that request data exists (has not expired) and renders the forms for the user to complete the request information.
Changes to the list of items requested are not allowed.
If the user aborts the request, it is deleted from the database. If the request expires due to a timeout set by Genesys, it is deleted from the database.
Completing the request
After the user provides the necessary request information, the existing Genesys request validation process kicks in: email validations may be sent, Easy-SMTA is checked, and eventually the request is relayed to the genebank holding the material.