Hi everyone.
I'm having an issue while creating a workspaceitem.
I'm following the api documentation and I'm getting a status 400 errror.
This is my code:
const submissionUrl = `
https://api-new-bcnroc.metricsalad.com/api/submission/workspaceitems?owningCollection=
${coleccio.uuid}`;
const submissionResponse = await fetch(submissionUrl, {
method: "POST",
headers: {
Authorization: bearerToken ?? "",
Cookie: xsrfCookie,
"Content-Type": "application/json",
"X-XSRF-TOKEN": csrfToken ?? "",
},
});
//console.log(submissionResponse);
const data = await submissionResponse.json();
const id = data.id;
const body1 = JSON.stringify({
id: id,
type: "workspaceitem",
sections: {
traditionalpageone: {
"dc.title": titol,
"dc.date.issued": dataPub,
"dc.type": tipusDocument,
},
},
});
const formUrl = `
https://api-new-bcnroc.metricsalad.com/api/submission/workspaceitems/${id}`;
const formResponse = await fetch(formUrl, {
method: "PATCH",
headers: {
Authorization: bearerToken ?? "",
Cookie: xsrfCookie,
"Content-Type": "application/json",
"X-XSRF-TOKEN": csrfToken ?? "",
},
body: body1,
});
console.log(formResponse);
The data I upload has the required format.
Can you please, give me some guidance?
Thanks for all your help
--
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 [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/dspace-tech/d18178d0-05e6-4448-94b6-adbbc85ebb57n%40googlegroups.com.