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
12
votes
3 answers

Webmasters API User does not have sufficient permission for site

I use google-api-php-client library to access webmaster tools data. When I wanted to list sitemaps, it appeared Fatal error: Uncaught exception 'Google_Service_Exception'(403) User does not have sufficient permission for site. See also:…
11
votes
2 answers

How to reduce the size of Google PHP library?

The size of Google php API Library is very large. I just want to send an email with the library. How can I reduce its size?
bng
  • 109
  • 5
11
votes
6 answers

Google Sign In for Websites causing "Signature verification failed" with JWT PHP library

Google web sign in has driven me positively crazy... I'm building a simple web application, and I'm trying to integrate Google's sign in feature into the website (https://developers.google.com/identity/sign-in/web/). The JavaScript seemed to go…
Chris Kempen
  • 9,491
  • 5
  • 40
  • 52
11
votes
1 answer

Google Analytics API - Cant add services after having authenticated

Within the google console I have created Credentials for an API Key - Type Server and for Oauth with Type Other. For the developer key I am using the API Key Credentials and for the client id/secret I am using the Oauth Credentials I am using the…
11
votes
3 answers

Trying to append a row to a Google Spreadsheet in PHP

I'm using Google's Client API via Composer (https://packagist.org/packages/google/apiclient) and I have successfully authenticated and received an access token. I am trying to add a row to a Google sheet in my drive, but I can't find any relevant…
praine
  • 405
  • 1
  • 3
  • 14
11
votes
4 answers

Google Analytics - Access api without login

I had successfully configured google analytics api and get successful data. I want to access analytics api without gmail login. i.e. I will hard code credentials to for login, but how to do it with PHP? Is there any api function to achive this task…
11
votes
1 answer

Use OAuth Refresh Token to Obtain New Access Token - Google API

My app is simple, it connects to the Google+ API to authenticate the user, and if successful, it retrieves the user's email and then performs a series of operations on a given database based on the email retrieved. My main issue is that every hour,…
daniel_c05
  • 11,438
  • 17
  • 60
  • 78
10
votes
2 answers

How to get additional scope information from Google PHP API payload?

I'm struggling with getting additional scope information from the Google PHP API. I'm using it in conjunction with JavaScript to get an access token (not sure if this is the correct way, but it works for me) I have a Google sign up button on my page…
Swen
  • 767
  • 1
  • 9
  • 31
10
votes
2 answers

Refresh oauth2 token google api and HWIOAuthBundle

How i can refresh token ? I use Google api with this token - it work but can't find how to refresh it, in this example we dont save expired time. I require `access_type: offline ` then $client = new Google_Client(); …
Developer
  • 2,731
  • 2
  • 41
  • 71
10
votes
2 answers

Google sheets API v4 Create sheet and invite users

I am using a service account authentication to create a google sheet using the Google Sheets API. I want to create a spreadsheet and somehow allow my team to open it. $private_key = file_get_contents($rootDir .…
10
votes
2 answers

How can I manage OAuth refresh tokens with Laravel?

The Socialiate plugin provides an implementation for OAuth in Laravel, but it seems to be designed for mostly for the purpose of allowing them to not have to make a user account on your own site. I am making an application that helps manage their…
10
votes
2 answers

Retrieving the Google API granted scopes for a client

We're using the hybrid auth flow, such that the client is requested for incremental grants via JS and the resulting code is passed up to our API server for processing. What we need is one of: Which scopes are available to a user, either via…
CJ Thompson
  • 2,729
  • 2
  • 22
  • 26
10
votes
6 answers

Getting "Unable to parse the p12 file..." Error With google-api-php-client

I've been searching for days and trying new and older version of google-api-php-client along with various other examples out there, but I can't seem to get around this error. The code below is the service-account example retrieved from GitHub and I…
theonlynewts
  • 121
  • 1
  • 1
  • 6
10
votes
1 answer

Upload large file to google drive with PHP Client Library

I am trying to use the Google Drive API via their PHP Client Library to upload a large file. Currently it fails because the only method seemingly available is the "simple" upload method. Unfortunately that requires you to load the entire file as…
pathfinder
  • 1,606
  • 18
  • 22
10
votes
2 answers

Google Drive API - PHP Client Library - setting uploadType to resumable upload

I am having serious issues with the documentation for the new google drive API client library. It seems this should be an easy one to answer without having to put it on stackoverflow. I am seriously considering rolling my own on this one, a 64 page…
pathfinder
  • 1,606
  • 18
  • 22