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:
- Perform an HTTP get to retrieve the xsrf-token and xsrf-cookie (server/api)
- Grab the xsrf-token and xsrf-cookie and use them in the POST request headers to the login endpoint (server/api/authn/login)
- 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.
- 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