google-api

Unable to query Google Search Console API using a Service Account

依然范特西╮ 提交于 2020-08-24 03:48:03
问题 I need to retrieve some data from Google Search Console (Webmaster Tools) using a service account. So far I've been able to retrieve an access_token for the service account which I need to append to the url of the request. The problem is that I can't find a way to do so, this is the code i'm using: function retrieveSearchesByQuery(token) { gapi.client.webmasters.searchanalytics.query( { 'access_token': token, 'siteUrl': 'http://www.WEBSITE.com', 'fields': 'responseAggregationType,rows',

Unable to query Google Search Console API using a Service Account

霸气de小男生 提交于 2020-08-24 03:45:38
问题 I need to retrieve some data from Google Search Console (Webmaster Tools) using a service account. So far I've been able to retrieve an access_token for the service account which I need to append to the url of the request. The problem is that I can't find a way to do so, this is the code i'm using: function retrieveSearchesByQuery(token) { gapi.client.webmasters.searchanalytics.query( { 'access_token': token, 'siteUrl': 'http://www.WEBSITE.com', 'fields': 'responseAggregationType,rows',

Alternative to calling gapi.auth.authorize every time

此生再无相见时 提交于 2020-08-24 03:31:59
问题 I have a single-page web application that uses Google Apps Script Execution API to call functions that return the data I need. I based my project on the quick start sample code provided by Google. This requires the use of OAuth and I am accomplishing that via functions that make use of the client JavaScript library provided by Google. The first time a user is asked to authenticate the following function is used with immediate: false : gapi.auth.authorize({client_id: CLIENT_ID, scope: SCOPES,

Revoke access granted to my app Google Drive API

霸气de小男生 提交于 2020-08-21 06:13:53
问题 How do I revoke access that has been granted to my Google Drive web application so that upon the user's next use he is asked for permissions afresh? 回答1: If you clobbered all the refresh tokens in your DB, adding the query parameter approval_prompt=force to the auth request will fix that. It'll result in the refresh tokens getting reissued when the user next approves the request. 回答2: For revoking your access token, you need to "GET" (!) this url: https://accounts.google.com/o/oauth2/revoke

How to protect Google Maps API key on Ionic app?

六眼飞鱼酱① 提交于 2020-08-19 11:26:21
问题 I have Ionic PWA app published for Android and iOS (I used Capacitor to generate the native build). In the frontend code, it has my Google Maps API key, however, I can't restrict it to any of the options google offers because... HTTP referrers - It's not on a public domain name, it's on a local host within the webview of the native app. http://localhost/ for Android and capacitor://localhost/ for iOS. It does not seem very secure to use these as restrictions as they are very generic, and all

Format for a url that goes to Google image search?

♀尐吖头ヾ 提交于 2020-08-17 13:10:36
问题 I have a web page which has links at the bottom like this: - <a href='http://www.google.com/q?rome+photos'>photos of rome</a> - <a href='http://www.google.com/q?paris+photos'>photos of paris</a> - <a href='http://www.google.com/q?london+photos'>photos of london</a> The idea is that if somebody clicks we go to Google search image page and we search for those images of those cities. The questions are: what's the right URL for starting an image search in Google is there a place in Google

Google My Maps - API

余生长醉 提交于 2020-08-17 12:59:49
问题 Is there any way to add Layers, Points, Directions or any data to a map in the Google My Maps, using API? I have searched in Google but didn't find a solution to do this. 回答1: Currently there is no any API to access MyMaps programmatically. I can see a feature request for this in the public issue tracker: https://issuetracker.google.com/issues/35820262 It looks like Google is evaluating the feasibility to implement the API, however, no timeline provided at the moment. Please star this feature

Creating events using the Google Calendar API and Service Account

偶尔善良 提交于 2020-08-10 22:50:04
问题 So I have setup my service account with domain wide delegation as described in this post Perform G Suite Domain-Wide Delegation of Authorit. In G Suite Admin Console I have authorized the service account to use the OAuth 2.0 scope: https://www.googleapis.com/auth/calendar. Every time I try to create an event I end up with this error GoogleJsonResponseException: 403 Forbidden { "code" : 403, "errors" : [ { "domain" : "calendar", "message" : "Service accounts cannot invite attendees without