I am looking for Google chat api code with service account. I tried following code but getting some errors, not sure what I am missing.
include_once BP."/lib/google-api/vendor/autoload.php";
$client = new Google\Client();
$client->setAuthConfig(BP."/scripts/hangout/mytee-products-e6e5368c4246.json");
$client->setApplicationName("Client_Library_Examples");
$client->setScopes(['https://www.googleapis.com/auth/chat.bot']);
try{
$service = new Google_Service_HangoutsChat( $client );
print_r($service->spaces->listSpaces());
}
catch(Exception $e){
print $e->getMessage();
}
{ "error": { "code": 404, "message": "Requested entity was not found.", "errors": [ { "message": "Requested entity was not found.", "domain": "global", "reason": "notFound" } ], "status": "NOT_FOUND" } }