To change a single entity, use the URL <baseURL>/api/entities.
HTTP method |
URI |
Body |
---|---|---|
Post |
<BaseURL>/api/entities |
{ "entities": [ { "table": "string", "uid": "string", "values": { "StringColumn": "string", "IntColumn": 0, "DateColumn": "2016-0519T11:21:33.579Z", "DoubleColumn": 3.14, "BoolColumn": true } } ], "insertMissing": false } |
Parameter | Description | Parameter type | Data type |
---|---|---|---|
entities | List of entities to create (required). | Body | array[UpdateEntity] |
insertMissing | Insert entities that could not be found using the supplied keys. | Body | Boolean |
Body schema:
BulkChangeBodyUpdate {
entities(Array[UpdateEntity]),
insertMissing(boolean,default: false)
}
UpdateEntity {
table(string),
uid(string),
values(SampleValues, optional)
}
SampleValues {
StringColumn(string, optional),
IntColumn(integer, optional),
DateColumn(date - time, optional),
BoolColumn (boolean, optional)
}
Response Code:
204
Example 1:
This sample demonstrates the change of existing entities while omitting the insertMissing parameter in the body.
https://<Hostname>/AppServer/api/entities
Body:
{
"entities": [
{
"table": "Person",
"uid": "8a2eee88-0615-4595-a903-8388ca74d877",
"values": {
"LastName": "Coleman",
"IsExternal": false,
"ExitDate": "2032-12-31"
}
},
{
"table": "Person",
"uid": "df563a8c-203a-4132-8fcb-bc4adabb35b6",
"values": {
"FirstName": "Rosalie",
"LastName": "Meyer",
"IsExternal": True,
"BirthDate": "1991-03-21",
"Gender": 2,
"ExitDate": "2032-12-31",
}
}
]
}
Response Code:
204
Example 2:
This sample demonstrates the change of existing entities using the insertMissing parameter in the body to create non-existing entities.
https://<Hostname>/AppServer/api/entities
Body:
{
"entities": [
{
"table": "Person",
"uid": "8a2eee88-0615-4595-a903-8388ca74d877",
"values": {
"FirstName": "Jeremy",
"LastName": "Coleman",
"IsExternal": false,
"ExitDate": "2032-12-31"
}
},
{
"table": "Person",
"uid": "df563a8c-203a-4132-8fcb-bc4adaee35b6",
"values": {
"FirstName": "Rosalie",
"LastName": "Meyer",
"IsExternal": True,
"ExitDate": "2032-12-31",
}
}
]
"insertMissing": True
}
Response Code:
204