Hello,
I try to use the API to create an item like this :
const record = await client.items.create({
type: "item",
relationships: { item_type: { data: { type: "item_type", id: "1010" } } },
attributes: {
description: "test3",
data: {
fr: [
{
relationships: {
item_type: { data: { type: "item_type", id: "2020" } },
},
type: "item",
attributes: {
label: "test",
},
},
],
en: [
{
relationships: {
item_type: { data: { type: "item_type", id: "2020" } },
},
type: "item",
attributes: {
label: "test",
},
},
],
es: [
{
relationships: {
item_type: { data: { type: "item_type", id: "2020" } },
},
type: "item",
attributes: {
label: "test",
},
},
],
de: [
{
relationships: {
item_type: { data: { type: "item_type", id: "2020" } },
},
type: "item",
attributes: {
label: "test",
},
},
],
it: [
{
relationships: {
item_type: { data: { type: "item_type", id: "2020" } },
},
type: "item",
attributes: {
label: "test",
},
},
]
},
},
});
I get an error 422 Unprocessable Entity :
[
{
“id”: “2431af”,
“type”: “api_error”,
“attributes”: {
“code”: “INVALID_FORMAT”,
“details”: {
“messages”: [
“#/data: failed schema #/definitions/item/links/3/schema/properties/data: "relationships" wasn’t supplied.”
]
}
}
}
]
But all relationships are provided.
I need some help thank you