I want to run a function on my cloud code "test". This is my complete cloud code.
Parse.serverURL = 'http://MY_IP.compute-1.amazonaws.com/parse/';
Parse.Cloud.define("countUsers", function(request, response) {
var query = new Parse.Query("_Users");
query.count({
success: function(count) {
response.success(count);
},
error: function(error) {
response.error("Count failed" + error.message);
}
});
});
Parse.Cloud.define('hello', function(request, response) {
response.success('Hi'); // it works
});
Parse.Cloud.job('test', function(request, response){
response.success('OK');
});
When I call it via postman I get this error
{
"code": 141,
"error": "Invalid function: \"hello\""
}
Any idea what I might have done wrong?
You probably forgot to define your Webhooks for your function. You can easily define the function in the Webhooks section in Parse Dashboard.