ReadGroupEntitiesPage
Retrieve a page of group entity information based on the specified context. The groupId is required as part of the searchCriteria of the context.
After retrieving a page of entities with this method use getPageOffset
to retrieve previous or next pages.
See the Generic Paged Queries documentation for creating the context object.
Service | Operation |
---|---|
group | READ_GROUP_ENTITIES_PAGE |
Method Parameters
Parameter | Description |
---|---|
context | The JSON context for the page request |
Usage
http://localhost:3000
- C#
- C++
- Objective-C
- Java
- JavaScript
- Dart
- Cloud Code
- Raw
string context = "{\"pagination\":{\"rowsPerPage\":50,\"pageNumber\":1},\"searchCriteria\":{\"groupId\":\"130745f4-df57-4162-8f90-d89214fc8512\",\"entityType\":\"BLUE\"},\"sortCriteria\":{\"createdAt\":1,\"updatedAt\":-1}}";
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.Group.ReadGroupEntitiesPage(context, successCallback, failureCallback);
const char *context = "{\"pagination\":{\"rowsPerPage\":50,\"pageNumber\":1},\"searchCriteria\":{\"groupId\":\"130745f4-df57-4162-8f90-d89214fc8512\",\"entityType\":\"BLUE\"},\"sortCriteria\":{\"createdAt\":1,\"updatedAt\":-1}}";
_bc->getGroup()->readGroupEntitiesPage(context, this);
NSString *context = @"{\"pagination\":{\"rowsPerPage\":50,\"pageNumber\":1},\"searchCriteria\":{\"groupId\":\"130745f4-df57-4162-8f90-d89214fc8512\",\"entityType\":\"BLUE\"},\"sortCriteria\":{\"createdAt\":1,\"updatedAt\":-1}}";
BCCompletionBlock successBlock; // define callback
BCErrorCompletionBlock failureBlock; // define callback
[[_bc groupService] readGroupEntitiesPage:context
completionBlock:successBlock
errorCompletionBlock:failureBlock
cbObject:nil];
String context = "{\"pagination\":{\"rowsPerPage\":50,\"pageNumber\":1},\"searchCriteria\":{\"groupId\":\"130745f4-df57-4162-8f90-d89214fc8512\",\"entityType\":\"BLUE\"},\"sortCriteria\":{\"createdAt\":1,\"updatedAt\":-1}}";
this; // implements IServerCallback
_bc.getGroup().readGroupEntitiesPage(context, 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 context = {
"pagination": {
"rowsPerPage": 50,
"pageNumber": 1
},
"searchCriteria": {
"groupId": "130745f4-df57-4162-8f90-d89214fc8512",
"entityType": "BLUE"
},
"sortCriteria": {
"createdAt": 1,
"updatedAt": -1
}
};
_bc.group.readGroupEntitiesPage(context, result =>
{
var status = result.status;
console.log(status + " : " + JSON.stringify(result, null, 2));
});
var context = {
"pagination": {
"rowsPerPage": 50,
"pageNumber": 1
},
"searchCriteria": {
"groupId": "130745f4-df57-4162-8f90-d89214fc8512",
"entityType": "BLUE"
},
"sortCriteria": {
"createdAt": 1,
"updatedAt": -1
}
};
ServerResponse result = await _bc.groupService.readGroupEntitiesPage(context:context);
if (result.statusCode == 200) {
print("Success");
} else {
print("Failed ${result.error['status_message'] ?? result.error}");
}
var context = {
"pagination": {
"rowsPerPage": 50,
"pageNumber": 1
},
"searchCriteria": {
"groupId": "130745f4-df57-4162-8f90-d89214fc8512",
"entityType": "BLUE"
},
"sortCriteria": {
"createdAt": 1,
"updatedAt": -1
}
};
var groupProxy = bridge.getGroupServiceProxy();
var postResult = groupProxy.readGroupEntitiesPage(context);
if (postResult.status == 200) {
// Success!
}
{
"service": "group",
"operation": "READ_GROUP_ENTITIES_PAGE",
"data": {
"context": {
"pagination": {
"rowsPerPage": 50,
"pageNumber": 1
},
"searchCriteria": {
"groupId": "130745f4-df57-4162-8f90-d89214fc8512",
"entityType": "BLUE"
},
"sortCriteria": {
"createdAt": 1,
"updatedAt": -1
}
}
}
}
JSON Response
{
"status": 200,
"data": {
"_serverTime": 1637946319239,
"results": {
"moreBefore": false,
"count": 3,
"items": [
{
"gameId": "20595",
"groupId": "fee55a37-5e86-43e8-942e-06bcbe1b701e",
"entityId": "91cfece7-debb-4698-ba6b-cd2cb432458d",
"ownerId": null,
"entityType": "BLUE",
"createdAt": 1462812680359,
"updatedAt": 1462812680359,
"version": 1,
"data": {},
"acl": {
"member": 2,
"other": 1
}
}
],
"page": 1,
"moreAfter": true
},
"context": "eyJzZWFyY2hDcml0ZXJpYSI6eyJncm91cElkIjoiZmVlNTVhMzct"
}
}