Uploading bitstreams via API (DSpace7.6)

392 views
Skip to first unread message

Antti Laurila

unread,
Oct 9, 2023, 9:38:39 AM10/9/23
to DSpace Technical Support
Hi!

I've tried to find the correct API endpoint (DSpace 7.6) for uploading bitstreams to the repository. All I could find where either managing the metadata of the bitstreams or move/delete operations per bitstream. Is this sort of operation possible with the 7.x version, with 5,x I was able to do this?

Otherwise, the experience with the new DSpace has been great!

Best regards,
Antti Laurila
University of Eastern Finland

DSpace Technical Support

unread,
Oct 16, 2023, 5:02:22 PM10/16/23
to DSpace Technical Support
Hi Antti,

You may have already discovered this, but *everything* you can do from the DSpace 7 User Interface is also possible to do via the REST API.  This is because the REST API is called everytime you click a link or button in the UI.  You can see all these REST API calls in your browser's Developers Tools while interacting with the UI.  Take a look at the "Network" tab in those Developer Tools.

Generally speaking, if you want to figure out how to do something via the REST API, just do it via the UI and see what calls it makes.  Then you can also check the docs for that specific endpoint at https://github.com/DSpace/RestContract/#readme

Tim

dataquest

unread,
Oct 17, 2023, 2:42:05 AM10/17/23
to DSpace Technical Support
Hello. We recently needed to upload bitstreams through REST API. We used following call:
{server-url}/server/api/core/bundles/ab01bfb5-a078-4e60-895f-50a71f1a3cb1/bitstreams
Please note that the UUID of the call is UUID of the Bundle, not the Item. 
We sent file in body in form-data. Key "properties" contains JSON with necessary metadata
and key "file" contains file.

Since you state you worked with other APIs, I don't think it would be helpful to
add information about tokens and authentication. 


I hope this can help you.

Best regards,
Majo

--
All messages to this mailing list should adhere to the Code of Conduct: https://www.lyrasis.org/about/Pages/Code-of-Conduct.aspx
---
You received this message because you are subscribed to the Google Groups "DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dspace-tech...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dspace-tech/9ff065f4-d354-47ca-87b1-f2a3fd5b5218n%40googlegroups.com.

Antti Laurila

unread,
Oct 24, 2023, 2:12:01 AM10/24/23
to DSpace Technical Support
Thank you so much, both of you. I indeed tried to find out the correct API endpoint using the browser devtools, but everything I saw seemed incorrect. And after these answers, it is so clear what was wrong: I kept looking for the item UUID instead of the bundle UUID and thought the API-calls to the bundle endpoint were meant for calling something else. This really helped me, thank you again!



- Antti
Reply all
Reply to author
Forward
0 new messages