Questions tagged [google-api-php-client]

The Google APIs Client Library for PHP provides access to many Google APIs. It is designed for PHP client-application developers and offers simple, flexible, powerful API access.

The Google APIs Client Library for PHP provides access to many Google APIs. It is designed for PHP client-application developers and offers simple, flexible, powerful API access.

Beta

This library is in Beta. We're comfortable enough with the stability and features of the library that we want you to build real production applications on it. We will make an effort to support the public and protected surface of the library and maintain backwards compatibility in the future. While we are still in Beta, we reserve the right to make incompatible changes. If we do remove some functionality (typically because better functionality exists or if the feature proved infeasible), our intention is to deprecate and provide ample time for developers to update their code.

Requirements

  • PHP 5.2.1 or higher
  • PHP JSON extension

Note: some features (service accounts and id token verification) require PHP 5.3.0 and above due to cryptographic algorithm requirements.

Developer Documentation

Google APIs Client Library for PHP

GitHub

2080 questions
19
votes
3 answers

How do I access the Google Spreadsheets API in PHP?

Starting with the Google Developer documentation on the Google Spreadsheets API, I found that "A number of client libraries are provided in various languages.", but Google only provides client libraries for Java and .NET. For a PHP library, they…
Jo Sprague
  • 16,523
  • 10
  • 42
  • 62
18
votes
9 answers

Google API Client "refresh token must be passed in or set as part of setAccessToken"

I am currently facing a very strange problem, indeed I've been following this very same guide (https://developers.google.com/google-apps/calendar/quickstart/php) from Google API documentation. I tried it twice, at the first time it work like a charm…
18
votes
6 answers

Google Cloud API - Application Default Credentials

I have the following code, modified from Google's documentation: $GOOGLE_APPLICATION_CREDENTIALS = "./[path].json"; $_ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "./[path].json"; $_SERVER["GOOGLE_APPLICATION_CREDENTIALS"] =…
Laef
  • 1,086
  • 2
  • 11
  • 27
18
votes
2 answers

Inserting Google Calendar Entries with Service Account

I'm trying to use a service account to create entries on a Google calendar. I'm really close on this, but the very last line won't work. I get a 500 Internal Service Error when I let this run. Otherwise, the program runs error free, for whatever…
AndroidDev
  • 20,466
  • 42
  • 148
  • 239
17
votes
1 answer

Google API PHP offline access, "invalid_grant: Code was already redeemed"

How to authorize a Google Client permanently until the user revokes authorization? I am trying to make an app that connects to Google Calendar. It has to run in PHP and therefore I am using the Google API PHP client provided by google. The app needs…
unfulvio
  • 826
  • 3
  • 19
  • 34
15
votes
1 answer

Google_Service_Directory - (403) Not Authorized to access this resource/api

I have a problem just using an example of actual version of PHP api, and using the "service-account.php" file of examples folder. the original is for show the "Books API", and with my personal credentials configuration it works well, but in my xcase…
Roberto
  • 191
  • 1
  • 1
  • 12
15
votes
2 answers

Get Calendar events between two dates

How to get all events between two specific dates. For example i only want to get events between 1st of March 2013 & 28th of March 2013. I am using Google Calendar API v3. While in Google Calendar API v1 there was the facility for search between 2…
Khawer Zeshan
  • 9,470
  • 6
  • 40
  • 63
14
votes
1 answer

Signing URLs with JWT for Google Cloud Storage using PHP

I've just started to upgrade my Google Cloud Storage code from API version 1.0 to version 2.0 and I'm having some troubles. With version 1.0 I used Signed URLs with great success, using .p12 files. However that's deprecated in the new version and I…
JohanLejdung
  • 353
  • 1
  • 4
  • 18
14
votes
2 answers

Accessing Google My Business API without login (using service account)

I want to access the locations associated with my account and their reviews, for that I am using the google my business API and I have access to it (it does work on oAuthplayground). Now I want to access the google my business api without logging…
14
votes
3 answers

Google Calendar API Library (PHP) - Where is the documentation?

I have been looking for documentation of the Google Calendar API functions, methods, etc. from the PHP Google Client Library, but can't for the life of me find the damn thing. Does anyone know where this lives? I went in the Groups, but there is a…
13
votes
1 answer

Error when creating too many playlists?

I used the YouTube API but a new error appears recently when creating playlist: { "error": { "errors": [ { "domain": "youtube.playlist", "reason": "exceededRateLimit", "message": "The user has created too many playlists recently.…
13
votes
2 answers

Insufficient authentication scopes error using Google API

I set up Google SDK to use Google API with Application Default Credentials. For my local machine, created a credentials json file and set its path as GOOGLE_APPLICATION_CREDENTIALS as environment variable. This is worked as expected without a…
13
votes
1 answer

Google Drive API v3 - downloading files in PHP

I'm trying to understand the download flow for the Google Drive API v3 using PHP. Using the API v2 to download a file I: Got the file metadata Used the downloadUrl parameter to get a direct link to the file, attached an oAuth token to it and made a…
jeonatl3
  • 575
  • 1
  • 4
  • 10
13
votes
2 answers

How to Create a Project in Google Developers Console

I am trying to create a project in Google Developers Console. Note: I am the Domain Administrator. I keep getting this error message; Error Developers Console has not been activated for your account. Your account may be suspended or disabled. If you…
13
votes
4 answers

Uploading file to specific folder using google drive api with PHP

I am using google drive api to upload files, This is my code so far now the file upload to my root and I want to change the path to another folder,
Ali
  • 131
  • 1
  • 1
  • 4