SysGetMilestonePageOffset
Retrieves the next/prev page of milestones.
Note that this call does not return milestones (i.e. tasks) that are embedded within Quests. Use the Quests API for those.
See the Generic Paged Queries documentation for creating the context object.
Service | Operation |
---|---|
gamification | SYS_GET_MILESTONE_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": {
"milestoneId": 1
}
};
var gameficationProxy = bridge.getGamificationServiceProxy();
var milestonePage = gameficationProxy.sysGetMilestonePage(context);
var encodedContext = "";
if ( milestonePage.status == 200 ) {
if ( milestonePage.data.results.moreAfter == true ) {
//...
// Get the next page...
encodedContext = milestonePage.data.context;
milestonePage = gamificationProxy.sysGetMilestonePageOffset(encodedContext, 1);
if ( milestonePage.status == 200 ) {
// Success!
}
}
}
var context = {
"pagination": {
"rowsPerPage": 2,
"pageNumber": 1
},
"searchCriteria": {},
"sortCriteria": {
"milestoneId": 1
}
};
var gameficationProxy = bridge.getGamificationServiceProxy();
var milestonePage = gameficationProxy.sysGetMilestonePage(context);
var encodedContext = "";
if ( milestonePage.status == 200 ) {
if ( milestonePage.data.results.moreAfter == true ) {
//...
// Get the next page...
encodedContext = milestonePage.data.context;
milestonePage = gamificationProxy.sysGetMilestonePageOffset(encodedContext, 1);
if ( milestonePage.status == 200 ) {
// Success!
}
}
}
JSON Response
{
"status": 200,
"data": {
"context": "eyJzZWFyY2hDcml0ZXa...",
"results": {
"count": 3,
"page": 2,
"items": [
{
"milestoneId": "3",
"questId": null,
"title": "Egg Crusher",
"description": "Crushing Eggs lifetime milestone",
"category": "mission",
"extraData": {
"batmanIs": "awesome2"
},
"rewards": {
"experiencePoints": 30,
"achievement": "ACH001",
"currency": {
"coins": 5
},
"globalStatistics": {
"globalxp": 30
},
"statistics": {
"a3": 1,
"secretMissions": 1
}
},
"thresholds": {
"playerStatistics": {
"experienceLevel": 1,
"experiencePoints": 10,
"statistics": {
"returningDay": 7
}
}
},
"unlockThresholds": {
"playerStatistics": {
"experienceLevel": 2,
"experiencePoints": 10,
"statistics": {
"foodc": 5
}
},
"globalStatistics": {
"food_unlock": 1
}
},
"createdAt": 1574691758570,
"updatedAt": 1574691922583,
"version": 4
}
],
"moreAfter": false,
"moreBefore": true
}
}
}