Skip to main content
Version: 5.7.0

ReadSingleton

Reads the custom entity singleton owned by the session's user.

ServiceOperation
customEntityREAD_SINGLETON

Method Parameters

ParameterDescription
entityTypeThe type of custom entity being read. Custom entity type must have option isOwned set to true.

Usage

http://localhost:3000
string entityType = "athletes";
SuccessCallback successCallback = (response, cbObject) =>
{
Debug.Log(string.Format("Success | {0}", response));
};
FailureCallback failureCallback = (status, code, error, cbObject) =>
{
Debug.Log(string.Format("Failed | {0} {1} {2}", status, code, error));
};

_bc.CustomEntityService.ReadSingleton(entityType, successCallback, failureCallback);
JSON Response
{
"data": {
"entityId": "12a57791-2600-47dc-ad3c-96a54c461a58",
"version": 1,
"acl": {
"other": 0
},
"ownerId": "cde6c0b2-e9e4-40e4-8c8a-91ebba5a2291",
"expiresAt": null,
"timeToLive": null,
"createdAt": 1590264448888,
"updatedAt": 1591815136870,
"entityType": "athletes",
"data": {
"firstName": "Super",
"surName": "Star",
"position" : "forward",
"goals": 2,
"assists": 4
},
"_serverTime": 1637946319239
},
"status": 200
}