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
0
votes
0 answers

How to properly load oauth credentials from storage

I'm trying to use laravel and google analytics to be able to build a report, the problem I'm getting is this { "error": { "code": 400, "message": "CLIENT_ID: {my_client_id} not found.", "errors": [ { "message": "CLIENT_ID: {my_client_id} not…
Aurilie
  • 189
  • 3
  • 14
0
votes
1 answer

What is the proper format of request for querying a report?

Good afternoon everyone! I need to get the estimatedMinutesWatched parameter from YouTube's Analytics API. I found some examples on the internet, for example this one, and they all used the method: $api = $analytics->reports->query($id, $start_date,…
0
votes
1 answer

Download Multiple Google Drive Files as a Zipped File

Once the user login to the portal, a list of PDF reports are displayed. In order to download the reports in demand, user can check/uncheck the box associated to each report. For Instance, There are 10 reports in the list. User has selected 7…
0
votes
0 answers

Trying to access GoogleSheet by using google-api-php-client but failed

I am trying to access Google Sheet using php through google-api-php-client library but getting AuthError exception. index.html
First name:
Email:
Shubham
  • 25
  • 1
  • 1
  • 9
0
votes
1 answer

Dialogflow v2 PhP Set Context in Detect Intent

I am trying to set the context with the following code. $text = "Some Text"; $sessionsClient = new SessionsClient(array('credentials' => base_path('/google-cloud.json'))); $session = $sessionsClient->sessionName('[project-id]', uniqid()); …
Bhaktij
  • 109
  • 1
  • 6
0
votes
2 answers

Class 'Google_Service_Gmail_Message' not found

I'm trying to develop a web application that send email throught Gmail API. But I'm getting this error Fatal error: Uncaught Error: Class 'Google_Service_Gmail_Message' not found in /var/www/html/wordpress/multi_users/approval.php:18 Stack trace:…
user14283922
0
votes
0 answers

Google Slides API batchUpdate memory exhausted

I am attempting to do 25 or so text replacement updates via the batchUpdate() function for Google Slides in PHP. I continue to receive the following error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 260050944 bytes) Here is…
0
votes
1 answer

Sharing file in team drive publicly

I've been trying to set permissions of a file I upload through code to a shared drive through a service account so that the file is publicly visible, unfortunately everything I've tried thus far doesn't seem to be working. Uploading the file to the…
0
votes
1 answer

Google Access token not refreshing automatically with offline access

I'm working on a PHP web application that creates Google contacts after the user has authorized permission. I dont want to prompt the user everytime new contact is created, so I found this:…
0
votes
0 answers

Parse error: syntax error, unexpected '?', expecting variable (T_VARIABLE) while setting up google signup

I am facing issue in google signup process. My site is in core php. a month before it was working, suddenly stopped. When I click on "sign-in-with-google" button, It prompts me to select the email. When I select the select the email to proceed after…
0
votes
1 answer

Delete folder if no files exist within it - Google Drive API

I currently have the function: function deleteFileUsingID($fileID) { $this->service->files->delete($fileID); } How would I have to modify it such that after deleting the file, if no files exists within that folder, it deletes the folder itself.
0
votes
0 answers

GMB PHP API 2020 Issues

I am working on the GMB API, facing some issues. I have implemented Google Oauth at frond-end and saving user listing in my DB. Now I want to run cron job in which I want to get those user`s listing insights. So issues are here 1: I can't find GMB…
0
votes
1 answer

Where can I see shared users for a file using Google Drive API?

I want to use Google Drive API to monitor documents within our organization and make sure that nobody is sharing files improperly. In order to do so, I need to be able to see who (or what groups) currently have access to a document in Drive. I…
Noah K
  • 77
  • 1
  • 8
0
votes
1 answer

Google fit REST API Cannot add some of the data source

I am trying to add a specific datasource and the scopes are https://www.googleapis.com/auth/fitness.activity.read https://www.googleapis.com/auth/fitness.activity.write But when I try to do so. It returns me an error of { "reason":…
draw134
  • 1,053
  • 4
  • 35
  • 84
0
votes
1 answer

Retrieve email/message in HTML-format using Gmail API

Is it possible to retrieve an message/email in html-format using Gmail API? As of now, I can read the full email/message, but only in plain text. I would like to view it for example on a website in html format. This is my code so far: $gmail = new…