DSpace 6 REST API PUT update no error but nothing update

65 views
Skip to first unread message

Kwan Boonmee

unread,
Sep 28, 2023, 6:46:26 AM9/28/23
to DSpace Community
Hello, 

I'm using DSpace 6, and I'm trying to update some metadata using the REST API. I've used a PUT request to update the metadata, and  I didn't see any errors. However, it looks like nothing actually changed or got updated. Does anyone have any idea on how I can fix this?

notes:

  • The server is set up with HTTPS.
  • I've logged in and have my session stored as a cookie.txt file for my code.
  • The record I'm trying to update is may not have " dc.identifier.doi" in the records.

Here's a sample of the curl code I've tried:


curl -X PUT -H "Content-Type: application/json" -d "[{\"key\":\"dc.identifier.doi\",\"value\":\"{doi number}\"},{\"key\":\"dc.relation.uri\",\"value\":\"{relation uri url}\"}]" "http://dummyaddress/rest/items/{itemcode}/metadata" -b  cookies.txt

Thank you very much!
Kwan




DSpace Community

unread,
Oct 4, 2023, 12:26:42 PM10/4/23
to DSpace Community
Hi Kwan,

I'd recommend looking at the DSpace logs to see if any information appears to provide you hints. It's possible for an error to appear in the logs which is *not* returned in the REST API response.

At a basic level though, it might be that you need to specify a "language" field for each metadata value, as this section of the docs implies it might be needed for a "MetadataEntry Object": https://wiki.lyrasis.org/display/DSDOC6x/REST+API#RESTAPI-MetadataEntryO

I also should stress that the DSpace 7 REST API has much better support & more consistent behavior (as it drives the new User Interface).  The older DSpace 6 REST API could be very buggy and hard to work with. 

Tim
Reply all
Reply to author
Forward
0 new messages