Stream: community

Topic: trying to delete file through API returns 403


view this post on Zulip Péter Pallinger (Nov 14 2024 at 13:36):

I tried this command line, and I got a 403 forbidden:
curl -i -u $API_TOKEN: -X DELETE https://$SERVER/data-deposit/v1.1/swordv2/edit-media/file/$ID

view this post on Zulip Péter Pallinger (Nov 14 2024 at 13:38):

My user is a superadmin on the server, but I also added myself as admin for the dataset.

view this post on Zulip Péter Pallinger (Nov 14 2024 at 13:39):

Can anyone suggest what I may have done wrong? I used the recipe from here: https://guides.dataverse.org/en/latest/api/sword.html#delete-a-file-by-database-id

view this post on Zulip Sherry Lake (Nov 14 2024 at 13:57):

I would use the Native API command:
https://guides.dataverse.org/en/latest/api/native-api.html#deleting-files

Using the example at that link.

I use only API commands from the Naive API list https://guides.dataverse.org/en/latest/api/native-api.html

I tried sword awhile back with mixed results.

view this post on Zulip Péter Pallinger (Nov 14 2024 at 14:08):

Thank you!
Somehow this eluded my attention; I vaguely remembered that deleting files was only possible through sword...

view this post on Zulip Péter Pallinger (Nov 14 2024 at 15:44):

Well, deleting returns an error after 50 minutes. This may be because the dataset contains 460k files, so I may have to delete the files using SQL...

view this post on Zulip Philip Durbin 🚀 (Nov 14 2024 at 16:27):

50 minutes? Yikes! Are there any errors in server.log for either method (native vs. SWORD)?


Last updated: Nov 01 2025 at 14:11 UTC