SysUpdateEntity
Replaces the specified custom entity's data, and optionally updates the acl and expiry, on the server. Ignores ownership/ACL checks.
Service | Operation |
---|---|
customEntity | SYS_UPDATE_ENTITY |
Method Parameters
Parameter | Description |
---|---|
entityType | The type of custom entity being updated. |
entityId | The id of custom entity being updated. |
version | Version of the custom entity being updated. |
dataJson | New custom data, as JSON, to replace existing custom data. |
acl | New access control list settings to replace existing acl. Optional, ignored if null. |
timeToLive | The duration of time, in milliseconds, the custom entity should live from now before being expired. Null indicates never expires. To indicate no change, use -1. |
Usage
http://localhost:3000
- C#
- C++
- Objective-C
- Java
- JavaScript
- Dart
- Cloud Code
- Raw
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
var entityType = "athletes";
var entityId = "aaaa-bbbb-cccc-dddd";
var version = 1;
var dataJson = {
"firstName": "Super",
"surName": "Star",
"position": "defense",
"goals": 3,
"assists": 5
};
var acl = {
"other": 0
};
var timeToLive = null;
var customEntityProxy = bridge.getCustomEntityServiceProxy();
var postResult = customEntityProxy.sysUpdateEntity(entityType, entityId, version, dataJson, acl, timeToLive);
if (postResult.status == 200) {
// Success!
}
{
"service": "customEntity",
"operation": "SYS_UPDATE_ENTITY",
"data": {
"entityType": "athletes",
"entityId": "aaaa-bbbb-cccc-dddd",
"version": 1,
"dataJson": {
"firstName": "Super",
"surName": "Star",
"position": "defense",
"goals": 3,
"assists": 5
},
"acl": {},
"timeToLive": null
}
}
JSON Response
{
"status": 200,
"data": {
"entityId": "1497cc7e-66cb-4682-9eac-c755523369a8",
"version": 2,
"acl": {
"other": 1
},
"ownerId": null,
"expiresAt": null,
"timeToLive": null,
"createdAt": 1573540122600,
"updatedAt": 1573540142928
}
}