I have just configured everything in google cloud console, i am using service account as auth method and i download key file as json. But i am getting this error
"Call failed with message: { "message": "Permission denied on resource Space (or it might not exist)", "code": 7, "status": "PERMISSION_DENIED", "details": [] }"
<?php
namespace AppHttpControllersPanel;
use AppHttpControllersController;
use GoogleApiCoreApiException;
use GoogleApiCoreValidationException;
use GoogleAppsMeetV2ClientSpacesServiceClient;
use GoogleAppsMeetV2CreateSpaceRequest;
use GoogleAppsMeetV2Space;
class YourControllerName extends Controller
{
public function __construct()
{
}
/**
* @throws ValidationException
*/
public function index()
{
$spacesServiceClient = new SpacesServiceClient([
'credentials' => storage_path('appgoogle-calendarcredentials.json')
]);
$request = new CreateSpaceRequest();
try {
$response = $spacesServiceClient->createSpace($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}