[Web API] Return SWHID of snapshot associated to a Save Code Now request
Some users of the Web API submitting Save Code Now requests are interested in retrieving the snapshot identifier resulting from the visit of a repository to save into the archive.
Currently, that process requires several Web API calls:
- Create a save request by sending a POST request to
/api/1/origin/save/(visit_type)/url/(origin_url)/
and saving loading task id - Send a GET request to
/api/1/origin/save/(visit_type)/url/(origin_url)/
, get the request matching the loading task id and save the visit date - Send a GET request to
/api/1/origin/(origin_url)/visits/
, get the visit matching the date and retrieve the snapshot identifier
To avoid the extra Web API call to the visits endpoint, we could add the SWHID of the snapshot resulting from a save request directly in the data returned when making GET requests to /api/1/origin/save/(visit_type)/url/(origin_url)/
.