DSpace Rest API - create an archived item - server/api/core/items?owningCollection

71 views
Skip to first unread message

Sara Kiran

unread,
Dec 19, 2023, 9:56:27 AM12/19/23
to DSpace Community
Hi,

I am facing the error 422 in creating an archived item via Rest API. The version of DSpace that I am using is 7.6.
I am doing the following steps to create an item:
  1. Perform an HTTP get to retrieve the xsrf-token and xsrf-cookie (server/api) 
  2. Grab the xsrf-token and xsrf-cookie and use them in the POST  request headers  to the login endpoint (server/api/authn/login)
  3. Grab the bearer token and updated xsrf-token from the response headers for subsequent calls. Use both tokens to verify if status for authenticate is TRUE. (server/api/authn/status). Until this point, I got the status 200 and authenticate TRUE.
  4. Use the bearer token and updated xsrf-token in the POST request headers including content-type: application/json to create an item. (server/api/core/items?owningCollection=648) 
I get the following error at step 4.

{"timestamp":"2023-12-18T20:49:14.673+00:00","status":422,"error":"Unprocessable Entity","message":"Unprocessable or invalid entity","path":"/server/api/core/items"}

I would appreciate any help from the community. I am stuck on this error for days.

Thanks,
Sara


Reply all
Reply to author
Forward
0 new messages