google-api

What to do when Google Calendar API sync token is invalid?

不羁岁月 提交于 2020-02-04 21:43:11
问题 In the documentation for Google Calendar API, it says this: Sometimes sync tokens are invalidated by the server, for various reasons including token expiration or changes in related ACLs. In such cases, the server will respond to an incremental request with a response code 410. This should trigger a full wipe of the client’s store and a new full sync. A lot of sync tokens in my system are being invalidated, and I don't know why. I am getting this error for a lot of calendars: (410) Sync token

Google API HTTP 401 - Token invalid - AuthSub token has wrong scope

狂风中的少年 提交于 2020-02-04 12:14:24
问题 I'm struggling with google api for a few days while sending a post request to Google sites API via C# application. First I redeem the authorization code from google's servers by a GET request: https://accounts.google.com/o/oauth2/auth? scope=email%20profile& state=security_token%3D138r5719ru3e1%26url%3Dhttps://oa2cb.mydomain/myHome& redirect_uri=http://localhost& response_type=code& client_id= // CLIENT ID here... access_type=online& approval_prompt=auto In the redirect uri I got the

How to do simple google script api with php

瘦欲@ 提交于 2020-02-04 05:27:28
问题 I am trying to figure out how to call a google script via the api from php. Here is my script: function doGet() { return ContentService.createTextOutput("hello world!"); } I can call it as a web app via it's URL but what I am trying to accomplish will require it be called via the API. Google's documentation is so confusing it's almost useless. This seems like it would be such a simple task but I'm getting nowhere fast. Does anyone know where to find a simple step by step tutorial or can

How to use Google Safe Browsing (v4) with .NET

半世苍凉 提交于 2020-02-04 04:05:25
问题 I am trying to use Googles Safe Browsing Lookup API (v4, https://developers.google.com/safe-browsing/v4/lookup-api ) with a .NET application and had trouble finding example code. I installed Google's nuget package but could find no examples on their github repo at https://github.com/google/google-api-dotnet-client The best example I could find was at https://developers.google.com/api-client-library/dotnet/get_started but even that does not show me exactly what I am looking for. I just want to

google access api with php curl

蓝咒 提交于 2020-02-02 23:39:46
问题 I am trying to fetch my user's emails with google api & curl, and I am stuck on redeeming access token. I get the key no problem, but when it comes to token, google just returns json {"error" : "invalid_request"} below is a snippet which redeems code for token (well at least it supposed to) $code = urlencode($_GET["code"]); $secret = "MYSECRET"; $client_id = "MYCLIENTID"; $redirect_uri = urlencode("http://www.mysupersite.com/callback.html"); $grant_type = "authorization_code"; $url = "https:/

How to turn on/off CloudSQL instances using Python3

我怕爱的太早我们不能终老 提交于 2020-02-02 17:28:09
问题 I'm trying to use a Python script to turn on/off a CloudSQL Instance in GoogleCloud. I've finally found a way to do it, using the GoogleCloudAPI, in Shell: ### shell script ACCESS_TOKEN="$(gcloud auth print-access-token)" ACTIVATION_POLICY="ALWAYS/NEVER" # Use 'ALWAYS' to turn on, 'NEVER' to turn off curl --header "Authorization: Bearer ${ACCESS_TOKEN}" --header 'Content-Type: application/json' --data '{"settings" : {"activationPolicy" : "${ACTIVATION_POLICY}"}}' -X PATCH https://www

How to read events and delete all events in Google Calendar using API V3 PHP

与世无争的帅哥 提交于 2020-02-02 10:56:10
问题 After hours of reading Google API documentation and searching the web I managed to write a simple PHP function to insert an event into my Google Calendar (if anyone wants the code just ask). However the next thing I want to do is to delete the entire content of my Google calendar. Initially I thought I'd do this by reading all events and then deleting each one, but according to Google I can do this in a single command: $service->calendars->clear($cal_id); However since the Google API

User Sign-out: clearing the default Google account does not cause the account picker to show up in Android app

做~自己de王妃 提交于 2020-02-02 10:32:31
问题 I followed the below link to implement a "sign out" button in my android app, which uses a Google API client. However, upon connecting the google api again, the user is not presented with an account picker. It looks like the value of her/his original choice is somehow still cached perhaps. I've been trying to figure this out for a few hours. Any and all ideas very welcome. Thank you. https://developers.google.com/+/mobile/android/sign-in if (mGoogleApiClient.isConnected()) { Plus.AccountApi

User Sign-out: clearing the default Google account does not cause the account picker to show up in Android app

家住魔仙堡 提交于 2020-02-02 10:32:28
问题 I followed the below link to implement a "sign out" button in my android app, which uses a Google API client. However, upon connecting the google api again, the user is not presented with an account picker. It looks like the value of her/his original choice is somehow still cached perhaps. I've been trying to figure this out for a few hours. Any and all ideas very welcome. Thank you. https://developers.google.com/+/mobile/android/sign-in if (mGoogleApiClient.isConnected()) { Plus.AccountApi

User Sign-out: clearing the default Google account does not cause the account picker to show up in Android app

戏子无情 提交于 2020-02-02 10:32:25
问题 I followed the below link to implement a "sign out" button in my android app, which uses a Google API client. However, upon connecting the google api again, the user is not presented with an account picker. It looks like the value of her/his original choice is somehow still cached perhaps. I've been trying to figure this out for a few hours. Any and all ideas very welcome. Thank you. https://developers.google.com/+/mobile/android/sign-in if (mGoogleApiClient.isConnected()) { Plus.AccountApi