GetSharedEntitiesForProfileId
Method returns all shared entities for the given profile id.
An entity is shared if its ACL allows for the currently logged in user to read the data.
Service | Operation |
---|---|
entity | READ_SHARED |
Method Parameters
Parameter | Description |
---|---|
targetProfileId | The profile id to retrieve shared entities for |
Usage
http://localhost:3000
- C#
- C++
- Objective-C
- Java
- JavaScript
- Dart
- Cloud Code
- Raw
string targetProfileId = "profile1";
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.EntityService.GetSharedEntitiesForProfileId(targetProfileId, successCallback, failureCallback);
const char *targetProfileId = "profile1";
_bc->getEntityService()->getSharedEntitiesForProfileId(targetProfileId, this);
NSString *targetProfileId = @"profile1";
BCCompletionBlock successBlock; // define callback
BCErrorCompletionBlock failureBlock; // define callback
[[_bc entityService] getSharedEntitiesForProfileId:targetProfileId
completionBlock:successBlock
errorCompletionBlock:failureBlock
cbObject:nil];
String targetProfileId = "profile1";
this; // implements IServerCallback
_bc.getEntityService().getSharedEntitiesForProfileId(targetProfileId, this);
public void serverCallback(ServiceName serviceName, ServiceOperation serviceOperation, JSONObject jsonData)
{
System.out.print(String.format("Success | %s", jsonData.toString()));
}
public void serverError(ServiceName serviceName, ServiceOperation serviceOperation, int statusCode, int reasonCode, String jsonError)
{
System.out.print(String.format("Failed | %d %d %s", statusCode, reasonCode, jsonError.toString()));
}
var targetProfileId = "profile1";
_bc.entity.getSharedEntitiesForProfileId(targetProfileId, result =>
{
var status = result.status;
console.log(status + " : " + JSON.stringify(result, null, 2));
});
var targetProfileId = "profile1";
ServerResponse result = await _bc.entityService.getSharedEntitiesForProfileId(targetProfileId:targetProfileId);
if (result.statusCode == 200) {
print("Success");
} else {
print("Failed ${result.error['status_message'] ?? result.error}");
}
var targetProfileId = "profile1";
var entityProxy = bridge.getEntityServiceProxy();
var postResult = entityProxy.getSharedEntitiesForProfileId(targetProfileId);
if (postResult.status == 200) {
// Success!
}
{
"service": "entity",
"operation": "READ_SHARED",
"data": {
"targetPlayerId": "profile1"
}
}
JSON Response
{
"status": 200,
"data": {
"entities": [
{
"entityId": "544db68a-48ad-4fc9-9f44-5fd36fc6445f",
"entityType": "publicInfo",
"version": 1,
"data": {
"name": "john",
"age": 30
},
"acl": {
"other": 1
},
"createdAt": 1395943044322,
"updatedAt": 1395943044322
}
],
"_serverTime": 1637946319239,
"entityListCount": 1
}
}