1
votes

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.

1
Have you checked API documentation? See here google.github.io/php-photoslibrary/v1.1.0/classes/… - Labradorcode
@Labradorcode: let me check and try it - ReNiSh AR

1 Answers

0
votes

setAuthConfig() should receive a JSON:

$auth_data = json_decode(file_get_contents(AUTH_FILE), TRUE);
$client->setAuthConfig($auth_data);