Last active
January 25, 2017 20:55
-
-
Save garkbit/cc694cdb50bd37925494f63e941c031a to your computer and use it in GitHub Desktop.
Force Habitica quest to start
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){ | |
let userid = window.amplitude.options.userId; | |
let groupid = window.amplitude.options.userProperties.partyID; | |
let token = JSON.parse(window.localStorage.getItem('habit-mobile-settings')).auth.apiToken; | |
let url = "/api/v3/groups/" + groupid + "/quests/force-start"; | |
let http = new XMLHttpRequest(); | |
http.open('POST', url, true); | |
http.setRequestHeader("x-api-key", token); | |
http.setRequestHeader("x-api-user", userid); | |
http.onreadystatechange = function() { | |
console.log(http.responseText); | |
} | |
http.send(); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment