Hi,
It would be great to be able to call a Job using the js sdk (using the masterkey, so from a Cloud hook or Function). It would remove the need to use a lib like 'request-promise' and simplify the way we send params.
Thx,
Olivier
If anyone needs a Node.js example, here is my (modest) REST code:
const rp = require('request-promise');
async function runJob(jobName, params) {
const options = {
url: Parse.serverURL + '/jobs/' + jobName,
headers: {
'X-Parse-Application-Id': Parse.applicationId,
'X-Parse-Master-Key': Parse.masterKey
}
};
if (params) {
options.json = params;
}
return rp.post(options);
}
@flovilmart Where is Parse.Cloud.job defined in the JS SDK? I can do a PR for this.
The job is not defined in the JS SDK, but by the server. If you plan to expose it, please make it only available for node and only with master Key
That won't be needed thanks.
Most helpful comment
If anyone needs a Node.js example, here is my (modest) REST code: