GetSharedEntityForProfileId
Method returns a shared entity for the given profile and entity ID.
An entity is shared if its ACL allows for the currently logged in user to read the data.
Service | Operation |
---|---|
entity | READ_SHARED_ENTITY |
Method Parameters
Parameter | Description |
---|---|
targetProfileId | The profile id to retrieve shared entities for |
entityId | The ID of the entity that will be retrieved |
Usage
http://localhost:3000
- C#
- C++
- Objective-C
- Java
- JavaScript
- Dart
- Cloud Code
- Raw
string targetProfileId = "profile1";
string entityId = "someEntityId";
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.GetSharedEntityForProfileId(targetProfileId, entityId, successCallback, failureCallback);
const char *targetProfileId = "profile1";
const char *entityId = "someEntityId";
_bc->getEntityService()->getSharedEntityForProfileId(targetProfileId, entityId, this);
NSString *targetProfileId = @"profile1";
NSString *entityId = @"someEntityId";
BCCompletionBlock successBlock; // define callback
BCErrorCompletionBlock failureBlock; // define callback
[[_bc entityService] getSharedEntityForProfileId:targetProfileId
entityId:entityId
completionBlock:successBlock
errorCompletionBlock:failureBlock
cbObject:nil];
String targetProfileId = "profile1";
String entityId = "someEntityId";
this; // implements IServerCallback
_bc.getEntityService().getSharedEntityForProfileId(targetProfileId, entityId, 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";
var entityId = "someEntityId";
_bc.entity.getSharedEntityForProfileId(targetProfileId, entityId, result =>
{
var status = result.status;
console.log(status + " : " + JSON.stringify(result, null, 2));
});
var targetProfileId = "profile1";
var entityId = "someEntityId";
ServerResponse result = await _bc.entityService.getSharedEntityForProfileId(targetProfileId:targetProfileId, entityId:entityId);
if (result.statusCode == 200) {
print("Success");
} else {
print("Failed ${result.error['status_message'] ?? result.error}");
}
var targetProfileId = "profile1";
var entityId = "someEntityId";
var entityProxy = bridge.getEntityServiceProxy();
var postResult = entityProxy.getSharedEntityForProfileId(targetProfileId, entityId);
if (postResult.status == 200) {
// Success!
}
{
"service": "entity",
"operation": "READ_SHARED_ENTITY",
"data": {
"targetProfileId": "profile1",
"entityId": "someEntityId"
}
}
JSON Response
{
"status": 200,
"data": {
"entityId": "544db68a-48ad-4fc9-9f44-5fd36fc6445f",
"entityType": "publicInfo",
"_serverTime": 1637946319239,
"version": 1,
"data": {
"name": "john",
"age": 30
},
"acl": {
"other": 1
},
"createdAt": 1395943044322,
"updatedAt": 1395943044322
}
}