hermes icon indicating copy to clipboard operation
hermes copied to clipboard

Consider using the new InvenioRDM API for depositing

Open schlauch opened this issue 1 year ago • 7 comments

  • I tried to deposit something using hermes and a fresh InvenioRDM v12.0 instance.
  • It seems that there is no longer support for the /api/deposit/depositions endpoint in InvenioRDM v12.0.
  • Instead it seems that you have to use the following API: https://inveniordm.docs.cern.ch/reference/rest_api_drafts_records/ But this would require quite some rework in deposit/invenio.py. However, it could be worth as Zenodo might switch completely to the new API at some point and hermes would be ready for (new) self-hosted InvenioRDM instances.

At least, it seems in my first tests that zenodo already supports the new API:

curl -X POST https://zenodo.org/api/records -d "{}" -H "Content-Type: application/json" -H "Authorization: Bearer {token}"

{"created": "2024-12-17T18:52:25.501056+00:00", "modified": "2024-12-17T18:52:25.545082+00:00", "id": 14510420, "conceptrecid": "14510419", "metadata": {"access_right": "open", "relations": {"version": [{"index": 0, "is_last": false, "parent": {"pid_type": "recid", "pid_value": "14510419"}}]}}, "title": "", "links": {"self": "https://zenodo.org/api/records/14510420/draft", "self_html": "https://zenodo.org/uploads/14510420", "self_iiif_manifest": "https://zenodo.org/api/iiif/draft:14510420/manifest", "self_iiif_sequence": "https://zenodo.org/api/iiif/draft:14510420/sequence/default", "files": "https://zenodo.org/api/records/14510420/draft/files", "media_files": "https://zenodo.org/api/records/14510420/draft/media-files", "archive": "https://zenodo.org/api/records/14510420/draft/files-archive", "archive_media": "https://zenodo.org/api/records/14510420/draft/media-files-archive", "versions": "https://zenodo.org/api/records/14510420/versions", "record": "https://zenodo.org/api/records/14510420", "record_html": "https://zenodo.org/records/14510420", "publish": "https://zenodo.org/api/records/14510420/draft/actions/publish", "review": "https://zenodo.org/api/records/14510420/draft/review", "reserve_doi": "https://zenodo.org/api/records/14510420/draft/pids/doi", "access_links": "https://zenodo.org/api/records/14510420/access/links", "access_grants": "https://zenodo.org/api/records/14510420/access/grants", "access_users": "https://zenodo.org/api/records/14510420/access/users", "access_request": "https://zenodo.org/api/records/14510420/access/request", "access": "https://zenodo.org/api/records/14510420/access", "communities": "https://zenodo.org/api/records/14510420/communities", "communities-suggestions": "https://zenodo.org/api/records/14510420/communities-suggestions", "requests": "https://zenodo.org/api/records/14510420/requests"}, "updated": "2024-12-17T18:52:25.545082+00:00", "recid": "14510420", "revision": 4, "files": [], "owners": [{"id": "47466"}], "status": "draft", "state": "unsubmitted", "submitted": false}

schlauch avatar Dec 17 '24 19:12 schlauch

That's interesting. I can't find any reference to the old API being removed in any of the changelogs. Did you find out anything about this? If not, maybe you're just missing an old package or parameter in you installation 🤔

zyzzyxdonta avatar Dec 18 '24 08:12 zyzzyxdonta

The main question is whether InvenioRDM has any plans to add the "/deposit" endpoint. Right now you cannot use hermes with a recent InvenioRDM installation.

And - as a newbie - it seems that you can do all the depositing with the "/records" endpoint. Thus, my guess is:

  • Zenodo will as long as possible support both.
  • InvenioRDM will not introduce a legacy API endpoint.

schlauch avatar Dec 18 '24 08:12 schlauch

And to answer your question more concretely:

  • This is the official InvenioRDM demo instance: https://inveniordm.web.cern.ch/
    • The endpoint is not available there as well: https://inveniordm.web.cern.ch/api/deposit/depositions
    • Zenodo still has it: https://zenodo.org/api/deposit/depositions
  • In addition, there is no hint about this API in the API reference at all: https://inveniordm.docs.cern.ch/reference/rest_api_index/
  • Finally, I could not see anything in there Roadmap or issue tracker about this.

schlauch avatar Dec 18 '24 09:12 schlauch

It is still documented here: https://developers.zenodo.org/#depositions

zyzzyxdonta avatar Dec 18 '24 09:12 zyzzyxdonta

Yes, for Zenodo but my problem is with InvenioRDM.

schlauch avatar Dec 18 '24 09:12 schlauch

I know 😁

zyzzyxdonta avatar Dec 18 '24 09:12 zyzzyxdonta

But in the end, you could have both support for Zenodo and InvenioRDM on the basis of the records API. Right or am I wrong here?

And yes I know that this means some substantial rework effort. But first I want to figure out whether my assumption is correct.

I might be also willing to help with the implementation. However, let us talk about this end of January...

schlauch avatar Dec 18 '24 11:12 schlauch