SysGetQuestPageOffset
Retrieves the next/prev page of quests.
See the Generic Paged Queries documentation for creating the context object.
Service | Operation |
---|---|
gamification | SYS_GET_QUEST_PAGE_OFFSET |
Method Parameters
Parameter | Description |
---|---|
encodedContext | The json context from the previous page request. |
pageOffset | The positive or negative page offset to fetch. Uses the last page retrieved using the context string to determine a starting point. |
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 context = {
"pagination": {
"rowsPerPage": 2,
"pageNumber": 1
},
"searchCriteria": {},
"sortCriteria": {
"questId": 1
}
};
var gameficationProxy = bridge.getGamificationServiceProxy();
var questPage = gameficationProxy.sysGetQuestPage(context);
var encodedContext = "";
if ( questPage.status == 200 ) {
if ( questPage.data.results.moreAfter == true ) {
//...
// Get the next page...
encodedContext = questPage.data.context;
questPage = gamificationProxy.sysGetQuestPageOffset(encodedContext, 1);
if ( questPage.status == 200 ) {
// Success!
}
}
}
var context = {
"pagination": {
"rowsPerPage": 2,
"pageNumber": 1
},
"searchCriteria": {},
"sortCriteria": {
"questId": 1
}
};
var gameficationProxy = bridge.getGamificationServiceProxy();
var questPage = gameficationProxy.sysGetQuestPage(context);
var encodedContext = "";
if ( questPage.status == 200 ) {
if ( questPage.data.results.moreAfter == true ) {
//...
// Get the next page...
encodedContext = questPage.data.context;
questPage = gamificationProxy.sysGetQuestPageOffset(encodedContext, 1);
if ( questPage.status == 200 ) {
// Success!
}
}
}
JSON Response
{
"status": 200,
"data": {
"context": "eyJzZWFyY2hDcml0ZXJpY...",
"results": {
"count": 5,
"page": 2,
"items": [
{
"questId": "QUEST_CRUSH52",
"questType": "unorderedMinimal",
"questData": "0",
"title": "Crush 50 Eggs",
"description": "This is an updated description",
"category": "mission",
"extraData": {
"difficulty": 1
},
"rewards": {
"experiencePoints": 1000
},
"createdAt": 1574802052796,
"updatedAt": 1574809351418,
"version": 2,
"tasks": []
},
{
"questId": "quest001",
"questType": "unorderedComplete",
"questData": null,
"title": "quest001",
"description": "",
"category": "misc",
"extraData": null,
"createdAt": 1574266600502,
"updatedAt": 1574266600502,
"version": 1,
"tasks": []
}
],
"moreAfter": true,
"moreBefore": true
}
}
}