SysUpdateQuest
Updates the specified quest. Note that only the fields present in the JSON object will be updated. (i.e. to leave ACL as is, don't include it in the questJson
field).
Service | Operation |
---|---|
gamification | SYS_UPDATE_QUEST |
Method Parameters
Parameter | Description |
---|---|
questId | The id of the quest to update |
version | The current revision of the quest |
questJson | A json object describing the updated quest data. Only the fields present will be updated. |
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 questId = "QUEST_CRUSH52;
var gamificationProxy = bridge.getGamificationServiceProxy();
var readResult = gamificationProxy.sysReadQuest(questId);
if (readResult.status == 200) {
var version = readResult.data.version;
// Only including the fields to update
var questJson = {
"description": "This is an updated description"
}
var updateResult = gamificationProxy.sysUpdateQuest(milestoneId, version, questJson);
if (updateResult.status == 200) {
// Success!
}
}
// Cloud Code only. To view example, switch to the Cloud Code tab
JSON Response
{
"status": 200,
"data": {
"quest": {
"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": []
},
"tasks": {}
}
}