google-api-php-client

Google api refresh_token null and how to refresh access token

醉酒当歌 提交于 2019-11-26 18:29:53
问题 I use HWIO Bundle for google api and when I have response from google refreshToken = null why? How to refresh token oAuthToken = {HWI\Bundle\OAuthBundle\Security\Core\Authentication\Token\OAuthToken} [11] accessToken = "ya29.Ci8lA1JTu9CB81dOFy-nzszViRgCI2CvvKVrCd0Lq-8I0QR_dIrl-_7RccdGt1Islg" rawToken = {array} [4] access_token = "ya29.Ci8lA1JTu9CB81dOFy-nzszViRgCI2CvvKVrCd0Lq-8I0QR_dIrl-_7RccdGt1Islg" token_type = "Bearer" expires_in = 3578 id_token = "xxxxx" refreshToken = null expiresIn =

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

核能气质少年 提交于 2019-11-26 17:05:30
问题 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 library that "just works" is so far a "total headache" How the heck do you set the uploadType to "resumable" instead of the default "simple". I have searched the library for a way to do this, but it seems non-existent. Their only hint is the code

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

吃可爱长大的小学妹 提交于 2019-11-26 16:45:40
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 I need to access by directory.groups.get service to have the list of members accounts of a google groups mail list, so I change the original code in this: <?php session_start(); include_once "templates/base.php"; /************************************************ Make an API request authenticated with a service account. *****************************

Google Calendar API v3 - authenticate with hardcoded credentials

三世轮回 提交于 2019-11-26 10:36:13
问题 I am writing a PHP application that\'s supposed to allow users to add certain events to a private Google Calendar. The calendar is owned by me, and I need a way for PHP to communicate with the calendar API using fixed credentials (everyone can add events using a form on the website, but the calendar itself is not publicly visible). From what I have read, this is possible using ClientLogin in the v1 API. In the v3 API, however, the available options are OAuth2.0 or the API key. Using the API

Inserting Google Calendar Entries with Service Account

妖精的绣舞 提交于 2019-11-26 09:48:44
问题 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 that is worth. The Calendar.php file contents can be found here. The insert() method that I am trying to call begins on line 1455 of that file. <?php function calendarize ($title, $desc, $ev_date, $cal_id) { session_start(); /**********************

How to get step count from Google Fit REST API like Google Fit app?

ぐ巨炮叔叔 提交于 2019-11-26 08:26:42
问题 I\'m developing a PHP application which work with Google Fit APIs to collect daily user\'s step count. I want to get my step count from \"Jan 15 2015 00:00:00 GMT+0700\" to \"Jan 16 2015 00:00:00 GMT+0700\". - First, I get all my datasources. - Then, with each datasource which have datatype equal to \"com.google.step_count.delta\", I get datasets between above timestamps and add return values together. My code: https://gist.github.com/daitr-gu/472c4f18522172542cca My result: https://gist

Google Drive PHP API - Simple File Upload

末鹿安然 提交于 2019-11-26 08:09:20
问题 I am trying to write a small script to upload a local file to Google Drive, using Google Drive PHP API. The documentation is very poor maintained, but so far I am pretty sure the code should be looking like that: <?php include_once \'Google/Client.php\'; include_once \'Google/Service/Drive.php\'; include_once \'Google/Auth/OAuth2.php\'; $client = new Google_Client(); $client->setScopes(array(\'https://www.googleapis.com/auth/drive.file\')); $client->setClientId(\'dfgdfgdg\'); $client-

Token must be a short-lived token and in a reasonable timeframe

时光毁灭记忆、已成空白 提交于 2019-11-26 07:38:14
问题 I am having the same error as this. In my case it is happening when the app is trying to upload a file via Google Cloud Client API. POST https://www.googleapis.com/oauth2/v4/token 400 Bad Request Invalid JWT: Token must be a short-lived token and in a reasonable timeframe How I load the token is reading a service-account json file, and attach it to CURLOPT_HTTPHEADER in PHP. It did work properly for the past one month, so I am guessing that Google changed the way of authorization. Has anyone

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

此生再无相见时 提交于 2019-11-26 04:28:49
问题 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 I need to access by directory.groups.get service to have the list of members accounts of a google groups mail list, so I change the original code in this: <?php session_start(); include_once \"templates/base.php\"; /***************************