1

I have integrated google-api-php-client using composer in my Codeigniter PHP application. Google_Client is created successfully, and able to fetch sample api for Google Books. PhotoGallery service not working.

$client = new Google_Client();
$client->setAuthConfig('/path/to/json/my_credentials.json');
$client->setAccessType('offline');

$service = new Google_Service_PhotosLibrary($client);

The service object return below value:

{
 albums: { },
 mediaItems: { },
 sharedAlbums: { },
 batchPath: null,
 rootUrl: "https://photoslibrary.googleapis.com/",
 version: "v1",
 servicePath: "",
 availableScopes: null,
 resource: null,
 serviceName: "photoslibrary"
}

How to list albums using this service, and then also list the photos inside it.

ReNiSh AR
  • 2,782
  • 2
  • 30
  • 42

1 Answers1

0

setAuthConfig() should receive a JSON:

$auth_data = json_decode(file_get_contents(AUTH_FILE), TRUE);
$client->setAuthConfig($auth_data);
Adrian Mole
  • 49,934
  • 160
  • 51
  • 83
Avner
  • 1
  • 3