I need to call google scipt via api, so I did the following

  • I created an application for Oauth

  • Created gs script, saved

  • Deployed as executable api

My php code

$client = new \Google_Client(); $client->setAccessToken($_SESSION['access_token']); $service = new \Google_Service_Script($client); $request = new \Google_Service_Script_ExecutionRequest(); $request->setFunction('myFunction'); $response = $service->scripts->run('idScript', $request); 

And in the end I got this error.

  Fatal error: Uncaught Google_Service_Exception: { "error": { "code": 403, "message": "The caller does not have permission", "errors": [ { "message": "The caller does not have permission", "domain": "global", "reason": "forbidden" } ], "status": "PERMISSION_DENIED" } } 
  • And in the developer console in the section Допустимый тип приложений selected applications? - Ruslan Semenov
  • @RuslanSemenov And you can throw off the link where to look for the Permissible type of applications - Crown King
  • console.developers.google.com you must get a token, create a point and allow it to be used for web resources, better only to certain ones, or to everyone that google doesn’t like much. - Ruslan Semenov
  • I already did it all - Crown King
  • Well, there are applications there, allow for web otherwise Google denies access to data, if the server is configured locally, then disable restrictions altogether. - Ruslan Semenov

0