I am trying to run the code given below, where "myApp" is function Name in the Script which one I am trying to run.
ExecutionRequest request = new ExecutionRequest().setFunction("myApp").setDevMode(true);
try {
Operation op = service.scripts().run("some id", request).execute();
// Print results of request.
if (op.getError() != null) {
// The API executed, but the script returned an error.
System.out.println("Error");
} else {
System.out.println("Success");
}
} catch (GoogleJsonResponseException e) {
e.printStackTrace(System.out);
}
Its giveing error me like:
{ "code" : 404, "errors" : [ { "domain" : "global", "message" : "Requested entity was not found.", "reason" : "notFound" } ], "message" : "Requested entity was not found.", "status" : "NOT_FOUND" }
or if I am deploying this as a web app it's giving this type of error:
com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 Forbidden { "code" : 403, "errors" : [ { "domain" : "global", "message" : "The caller does not have permission", "reason" : "forbidden" } ], "message" : "The caller does not have permission", "status" : "PERMISSION_DENIED" }
What I have to do run the code perfectly????