google-api-ruby-client

Google API Server-to-Server Communication not working (Ruby implementation)

混江龙づ霸主 提交于 2021-01-29 08:05:59
问题 I have followed all the steps to set up a Domain-Wide Delegation of Authority (https://developers.google.com/admin-sdk/reports/v1/guides/delegation) and followed this link too (https://developers.google.com/identity/protocols/OAuth2ServiceAccount#delegatingauthority) and I ended up creating this class in Ruby. class Gsuite::ServiceAccount def initialize(person: nil) end def authorized_client Google::Auth::ServiceAccountCredentials.make_creds( authorizer = Google::Auth:

How to use auth token in Google API (Ruby) WebmastersV3 (service account access)

拈花ヽ惹草 提交于 2020-06-29 03:59:30
问题 I cannot connect the two pieces together: I am able to authenticate my service account and I know how to form the request for the information I need to retrieve from the API, but I cannot figure out how to make that request authenticated with the token. This builds an object from the credential file I got for the service account and generates token successfully: require 'googleauth' require 'google/apis/webmasters_v3' website = "https://example.com" scope = 'https://www.googleapis.com/auth

Google API Ruby Client - single user with OAuth 2.0

让人想犯罪 __ 提交于 2020-01-16 19:39:08
问题 the goal is to have one Google (YouTube) account for the web app. Users of the web app will be able to upload videos via this account to the one YouTube channel. After many hours im in the ends. I've found plenty of samples how to implement for Google user <-> web app interaction, but I don't need such comprehensive solution. I'm trying over OAuth 2.0 (as recommended) and with Google API Ruby Client (https://github.com/google/google-api-ruby-client) So far I have authorized the Google account

How to create a user with the Admin Directory api using the google-api-ruby-client?

痴心易碎 提交于 2020-01-14 13:15:35
问题 I've been trying a few combinations but can't seem to come up with something that works. More information about the API I'm asking about can be found here https://developers.google.com/admin-sdk/directory/v1/reference/users/insert . I have a feeling I'm just not setting up the request correctly. The following bit of code is known to work. I use it to set up the client that is able to query all the users. client = Google::APIClient.new(:application_name => "myapp", :version => "v0.0.0") client

How to create a user with the Admin Directory api using the google-api-ruby-client?

北城余情 提交于 2020-01-14 13:15:27
问题 I've been trying a few combinations but can't seem to come up with something that works. More information about the API I'm asking about can be found here https://developers.google.com/admin-sdk/directory/v1/reference/users/insert . I have a feeling I'm just not setting up the request correctly. The following bit of code is known to work. I use it to set up the client that is able to query all the users. client = Google::APIClient.new(:application_name => "myapp", :version => "v0.0.0") client

Google Custom search api discrepancy in result

≯℡__Kan透↙ 提交于 2020-01-06 23:42:29
问题 I am first trying the standard web search, image below, which returns 476 results I have the custom Google ruby api client and have the custom search engine and api key setup. This is my query client = Google::APIClient.new(application_name: 'Foo', application_version: 1, :authorization => nil) search = client.discovered_api('customsearch') result = client.execute( search.cse.list, 'key' => 'xxxxx.xxxx_xxxxx_mykey', 'q' => 'chateau palmer', 'siteSearch' => 'nytimes.com', 'siteSearchFilter' =>

continuous call of Google Prediction API gives response 'Undefined'

放肆的年华 提交于 2020-01-05 04:04:27
问题 In my application I have been calling google prediction API continuously for an array(size: 4000 aprox) of strings. I observed that after some api calls it starts giving response as Undefined , it continues for some time and then gives result fine. This is happening frequently. I have checked their api documentation, but couldn't find any rate limit or any such restriction. Also there was no error logged in Google API manager dashboard. Does anyone have any idea why its happening like that.

Google Calendar API in Ruby using Service Account

旧时模样 提交于 2020-01-02 08:47:07
问题 I'm trying to access the Google Calendar API in Ruby using a Service Account (e.g., server-to-server communication). I'm having difficulty finding a good tutorial/example of how to do this. I have created a service account, and downloaded a JSON private key file. How can I authenticated with the Calendar API using this JSON file and make a request for calendar information? The Ruby API examples don't contain examples for apps that aren't running on a Google Apps domain. To summarize, I'm

“Login Required” error when trying to create live broadcast using YoutubeV3 API

左心房为你撑大大i 提交于 2019-12-24 10:12:07
问题 I am trying to create a new broadcast using google-api-ruby-client YT = Google::Apis::YoutubeV3 client = YT::YouTubeService.new client.key = 'my-api-key-here' metadata = { snippet: { title: 'test', scheduled_start_time: '2018-02-23T14:50:00.000Z' }, status: { privacy_status: 'public' } } part = 'snippet' client.insert_live_broadcast(part, metadata, {}) When I execute this code I am getting Error -# <Google::Apis::AuthorizationError: Unauthorized> [5] pry(main)> CreateYoutubeBroadcast.execute

With Google API Client, how to create client

☆樱花仙子☆ 提交于 2019-12-21 07:45:48
问题 I'm working to use the Google API Client: https://github.com/google/google-api-ruby-client Specifically, I want to access Google Contacts via the Google API client using the following google_contacts_api.rb : https://gist.github.com/lightman76/2357338dcca65fd390e2 I am trying to use google_contacts_api.rb like so (x is intentional and is actually the correct keys): require './lib/google_contacts_api.rb' auth = User.first.authentications.first client = OAuth2::Client.new('x', 'x', :site =>