使用PHP Google Photos Api进行服务器到服务器的通信

时间:2019-04-07 06:44:36

标签: php google-photos-api server-to-server

我想通过网络服务器访问google照片。即我的网络服务器应调用google api并向我显示图片。 我已经在Google中创建了一个服务帐户,并且还创建了一个公用/专用密钥。但是我的php照片库出现问题,并显示以下错误消息:

可捕获的致命错误:参数1传递给Google \ Photos \ Library \ V1 \ Gapic \ PhotosLibraryGapicClient :: __ construct()必须为数组类型,对象已给定

有什么想法如何获取为PhotoLibraryClient加载的json凭证? 谢谢!

putenv('GOOGLE_APPLICATION_CREDENTIALS=myJson.json');
$client = new Google_Client();
$client->useApplicationDefaultCredentials();
$photosLibraryClient = new PhotosLibraryClient($client);

0 个答案:

没有答案
相关问题