-
-
Save giastfader/899c98e02bb5b9da0bf2 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| var getParseHeader = function () { | |
| return { | |
| "X-Parse-Application-Id": "ENTER_APP_ID", | |
| "X-Parse-REST-API-Key": "ENTER_API_KEY", | |
| "Content-Type": "application/json" | |
| }; | |
| }; | |
| var getParseUrl = function (className) { | |
| return "https://api.parse.com/1/classes/" + className; | |
| }; | |
| var fetchData = function (className, includes, skip, limit) { | |
| var url = getParseUrl(className); | |
| if (includes) { | |
| url += encodeURIComponent("?include=" + includes); | |
| } | |
| if (skip && limit) { | |
| url += encodeURIComponent("&skip=" + skip + "&limit=" + limit); | |
| } | |
| Box.log(url); | |
| var result = Box.WS.get(url, | |
| { | |
| headers: getParseHeader() | |
| }); | |
| return result.body.results; | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment