Hello,
is there a chance to create multiple cards at once via REST? Following situation: cmdbdemo available. Created a class “testclass” with two cards (no additional attributes, just ID and Description). When I query the cards via REST, I get the following result (meta truncated):
{
“data”: [
{
“Code”: null,
“Description”: “Record_1”,
“Notes”: null,
“_beginDate”: “2020-09-28T14:44:34.019897Z”,
“_id”: 123,
“_type”: “testclass”,
“_user”: “admin”
},
{
“Code”: null,
“Description”: “Record_2”,
“Notes”: null,
“_beginDate”: “2020-09-28T14:45:12.558551Z”,
“_id”: 345,
“_type”: “testclass”,
“_user”: “admin”
}
]
}
Then I stored the result in a dedicated file and replaced Record_1 with Record 3 and Record_2 with Record 4, changed the ID’s:
{
“data”: [
{
“Code”: null,
“Description”: “Record_3”,
“Notes”: null,
“_beginDate”: “2020-09-28T14:44:34.019897Z”,
“_id”: 1559000,
“_type”: “testclass”,
“_user”: “admin”
},
{
“Code”: null,
“Description”: “Record_4”,
“Notes”: null,
“_beginDate”: “2020-09-28T14:45:12.558551Z”,
“_id”: 2100000,
“_type”: “testclass”,
“_user”: “admin”
}
]
}
When I now try to add the new cards, I get only one new cards called “testclass”, but not Record_3 or Record_4:
curl -d @cards.json --cookie “CMDBuild-Authorization=mqoko9pwjm7pfgn0rbbtjhlk” -X POST -H “Content-Type: application/json”
http://server:8080/cmdbdemo/services/rest/v3/classes/testclass/cards | python -m json.tool
{
“Code”: null,
“Description”: null,
“Id”: 778582,
“IdClass”: “testclass”,
“IdTenant”: null,
“Notes”: null,
“_beginDate”: “2020-10-16T15:55:44”,
“_id”: 778582,
“_type”: “testclass”,
“_user”: “admin”
}
Is there any chance to upload an data array? Card per card works, but is way to slow.
Btw. when I repeat the command to add cards, I get additional cards called testclass inside the class testclass.
Thanks,
Marek