google-api-ruby-client

Determining the parameters for “discovered_api”

主宰稳场 提交于 2019-12-11 03:07:58
问题 This might be a really stupid question, but how do you determine the parameters to pass in the client "discovered_api" call? and then what is the executed "api_method" For instance, I'm trying to call the Admin SDK Users List call which is "GET https://www.googleapis.com/admin/directory/v1/users". There doesn't seem to be a clear way of extracting this from the API reference, or am I just looking in the wrong place? 回答1: I misunderstood the original question. I still think the other post is

Sending an email with ruby gmail api v0.9

大兔子大兔子 提交于 2019-12-10 17:08:22
问题 Does anyone have a simple example as to how to send an email from scratch with the v0.9 API. simply want an example of sending the following: m = Mail.new( to: "test1@test.com", from: "test2@test.com", subject: "Test Subject", body:"Test Body") Now to create that message object which is required to send,we can use: msg = Base64.urlsafe_encode64 m.to_s And then try to send (where message_object = msg): client = Google::Apis::GmailV1::GmailService.new #Appropriately authorised client.send_user

Receiving error 403 in Google Drive API - Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup

半腔热情 提交于 2019-12-10 16:26:00
问题 I'm using the Google Drive API for ruby, and I'm trying to insert a file into an user drive. I can insert the file with success, but then, when I try to get the file Self Link, this is the URL returned https://www.googleapis.com/drive/v2/files/1PxrbKaO2xwOonUO0TB0FO3pkZDnSmRKTvIUmXw0vL6w, that says that i have exceeded the number of unauthenticated requests. Well, I'm pretty sure I'm authenticated, because I followed all the tutorials and the code is almost the same. Anyone knows why is this

How do you add a Google Calendar to all users for a domain?

吃可爱长大的小学妹 提交于 2019-12-07 12:37:21
问题 I am having trouble figuring out how to add a calendar to all of a domain's users' CalendarList . So far I can successfully create the Calendar and create a domain wide ACL but I don't know how to insert the calendar into domain users' lists. Using the ruby client API it looks something like this: client = Google::APIClient.new service = client.discovered_api("calendar", "v3") calendar_response = JSON.parse(client.execute(:api_method => service.calendars.insert, :body => JSON.dump({"summary"

How to authorize the google-api-ruby-client?

回眸只為那壹抹淺笑 提交于 2019-12-07 01:35:59
问题 I'm working to get the google-api-ruby-client gem working following the basic usage example here: Basic usage require 'google/apis/drive_v2' Drive = Google::Apis::DriveV2 # Alias the module drive = Drive::DriveService.new drive.authorization = ... # See Googleauth or Signet libraries # Search for files in Drive (first page only) files = drive.list_files(q: "title contains 'finances'") files.items.each do |file| puts file.title end Where I'm stuck is drive.authorization . I have an authorized

#next_sync_token fo Google Calendar Events always return nil

醉酒当歌 提交于 2019-12-06 03:47:45
I created 3 events in Calendar, then I run response = @client.execute!( :api_method => @calendar_api.events.list, :parameters => { :calendarId => "primary", :maxResults => 10, :singleEvents => true, :orderBy => 'startTime'} ) I received 3 items but #next_sync_token method called on response.data returns nil (# next_page_token also returns nil but in this case it is correct). I tried to set :fields parameter to "nextSyncToken" but still nothing. I also made some updates on that events and #next_sync_token was still set to nil..Am I wrong? Maybe I made some mistake ? The call only with

Google Calendar API in Ruby using Service Account

前提是你 提交于 2019-12-06 01:02:05
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 looking for some help to understand how to Authenticating with the API using the API Ruby Client using the

How do you add a Google Calendar to all users for a domain?

若如初见. 提交于 2019-12-05 19:20:11
I am having trouble figuring out how to add a calendar to all of a domain's users' CalendarList . So far I can successfully create the Calendar and create a domain wide ACL but I don't know how to insert the calendar into domain users' lists. Using the ruby client API it looks something like this: client = Google::APIClient.new service = client.discovered_api("calendar", "v3") calendar_response = JSON.parse(client.execute(:api_method => service.calendars.insert, :body => JSON.dump({"summary" => "events"}), :headers => { "Content-Type" => "application/json" }).response.body) rule = { "scope" =>

How to authorize the google-api-ruby-client?

我们两清 提交于 2019-12-05 05:38:01
I'm working to get the google-api-ruby-client gem working following the basic usage example here: Basic usage require 'google/apis/drive_v2' Drive = Google::Apis::DriveV2 # Alias the module drive = Drive::DriveService.new drive.authorization = ... # See Googleauth or Signet libraries # Search for files in Drive (first page only) files = drive.list_files(q: "title contains 'finances'") files.items.each do |file| puts file.title end Where I'm stuck is drive.authorization . I have an authorized token already for the user via the gem omniauth-google-oauth2. How do I use that token with google-api

Google plus insert activity on stream

孤街浪徒 提交于 2019-12-05 02:47:08
问题 Tough time inserting an activity to google plus stream. After referring google developers guide. I found an example for java - https://developers.google.com/+/domains/posts/creating Is there a similar example to execute the activites.insert query using google-api-ruby-client. I followed following steps: Define access to app via omniauth-google-oauth2 GOOGLE_CONSUMER_KEY = google_config['KEY'] GOOGLE_CONSUMER_SECRET = google_config['SECRET'] google_scope = "userinfo.email, userinfo.profile,