Git Product home page Git Product logo

google-api-ruby-client-samples's Introduction

google-api-ruby-client-samples's People

Contributors

adamnbowen avatar dazuma avatar fmendez avatar icco avatar iwz avatar jsatk avatar luisramalho avatar lurraca avatar marknadig avatar mimming avatar sgomes avatar shyamrallapalli avatar sporkmonger avatar sqrrrl avatar stevebooks avatar vankobe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

google-api-ruby-client-samples's Issues

Access Content v2 web application application in rails

I am trying to make a connection to the API via a web application (multiple users) in rails. I can't find any straightforward example on how to do this. Could anyone help me with an example on how to authenticate (get an access token and refresh token) and connect to the API?

How to access calendar?

Sorry I am a bit frustrated after spending the whole day trying to get the entries from public calendar feed. It should be trivial but due to absence of V2 API docs I had to abandon a working implementation of XML calendar feed parser and now I am here.

I don't understand how to get access to the calendar. There is no "Registered apps" nor "REGISTER APP", no "Web application" for the "Platform".

All I need is to get a handful of upcoming events from a public calendar. Should be easy right?

GA Experiment update without ID causes fatal error

When calling "client.discovered_api('analytics', 'v3').management.experiments.update" and failing to pass in the id attribute to the body, Webrick (test environment) dies with:
Illegal instruction: 4

I think I'd prefer it to raise an exception. But, that's just personal preference.

Gmail Example?

I am trying to create a draft but am getting the error Missing draft message

require 'google/api_client'
client = Google::APIClient.new
client.authorization.client_id = ENV['GOOGLE_CLIENT_ID']
client.authorization.client_secret = ENV['GOOGLE_CLIENT_SECRET']
client.authorization.grant_type = 'refresh_token'
client.authorization.refresh_token = User.last.refresh_token
token = client.authorization.fetch_access_token!
gmail = client.discovered_api('gmail', 'v1')
params = { 'userId' => 'me', 'draft' => { 'message' => {'raw' => 'test email' } } }
# { 'userId' => 'me', 'message' => {'raw' => 'test email' } }
result = client.execute(api_method: gmail.users.drafts.create, parameters: params)

I also tried the commented out hash and received the same error. Any ideas?

Wrong dependency versions in googleplus example

Step to reproduce the problem:

  1. bundle install
  2. bundle exec rackup
    result:
bundle exec rackup
bundler: failed to load command: rackup (/Users/frojas/.rvm/gems/ruby-2.3.1/bin/rackup)
LoadError: cannot load such file -- google/api_client
  /Users/frojas/.rvm/gems/ruby-2.3.1/gems/google-api-omniauth-0.1.1/lib/omniauth/strategies/google.rb:1:in `require'
  /Users/frojas/.rvm/gems/ruby-2.3.1/gems/google-api-omniauth-0.1.1/lib/omniauth/strategies/google.rb:1:in `<top (required)>'
  /Users/frojas/.rvm/gems/ruby-2.3.1/gems/google-api-omniauth-0.1.1/lib/omniauth/google.rb:17:in `require'
  /Users/frojas/.rvm/gems/ruby-2.3.1/gems/google-api-omniauth-0.1.1/lib/omniauth/google.rb:17:in `<top (required)>'
  /Users/frojas/.rvm/gems/ruby-2.3.1/gems/google-api-omniauth-0.1.1/lib/google/omniauth.rb:16:in `require'
  /Users/frojas/.rvm/gems/ruby-2.3.1/gems/google-api-omniauth-0.1.1/lib/google/omniauth.rb:16:in `<top (required)>'
  /Users/frojas/git/frojasg/google-api-ruby-client-samples/googleplus/config.ru:5:in `require' 

It seems google-api-omniauth depends on google-api-client version '0.4.X'.

The following change should fix the problem for me

--- a/googleplus/Gemfile
+++ b/googleplus/Gemfile
@@ -1,6 +1,7 @@
 source 'https://rubygems.org'

-gem 'google-api-client', '>= 0.8'
+gem 'google-api-client', '0.4.7'
 gem 'omniauth', '>= 1.1.1'
 gem 'google-api-omniauth', '>= 0.1.0'
 gem 'sinatra', '>= 1.3'
+gem 'jwt', '0.1.13'

Should I submit a PR for this change?

DoubleclickbidmanagerV1 returns Google::Apis::ServerError 500

Doubleclickbidmanager = Google::Apis::DoubleclickbidmanagerV1
service = Doubleclickbidmanager::DoubleClickBidManagerService.new

Any method call to this service(ex: service.list_queries) returns 500 Apis Server Error.

service itself seems to be right class but I'm not sure how or where to look for the issue. Any ideas?
#<Google::Apis::DoubleclickbidmanagerV1::DoubleClickBidManagerService:0x007f9bc1700710...

403 error in Google Analytics / Service Account

I can't get the Google Analytics / Service Account sample to work. Set everything up, but the attempt to fetch a result fails (quietly) with this hash of headers:

{"www-authenticate"=>"Bearer realm=\"https://accounts.google.com/AuthSubRequest\", error=insufficient_scope, scope=\"https://www.googleapis.com/auth/analytics\"",
       "content-type"=>"application/json; charset=UTF-8",
       "date"=>"Wed, 06 Aug 2014 18:15:29 GMT",
       "expires"=>"Wed, 06 Aug 2014 18:15:29 GMT",
       "cache-control"=>"private, max-age=0",
       "x-content-type-options"=>"nosniff",
       "x-frame-options"=>"SAMEORIGIN",
       "x-xss-protection"=>"1; mode=block",
       "server"=>"GSE",
       "alternate-protocol"=>"443:quic",
       "connection"=>"close",
       "transfer-encoding"=>"chunked"}

Problem with login - JWT

Hello guys.
I'm using this gem to make a login in analytics.

  scope="https://www.googleapis.com/auth/analytics.readonly"
  file = "#{File.expand_path File.dirname(__FILE__) }/../myfiletologin.p12"
  key = Google::APIClient::PKCS12.load_key(file, "keepthissecret")
  service_account = Google::APIClient::JWTAsserter.new("[email protected]", scope, key)
  client.authorization = service_account.authorize # ERROR!

I'm receiving error:

#<Signet::AuthorizationError: Authorization failed.  Server message:
{
  "error" : "invalid_grant",
  "error_description" : "Invalid JWT: Token must be a short-lived token and in a reasonable timeframe"
}>

How can I do to solve this? What's a possible problem?

file_storage not exists within api client gem

Just tried calendar connection sample and noticed that in current api client gem (google-api-client-0.6.4) does not contain google/api_client/auth/file_storage library, that leads to being unable to use sample out of box.

Error when trying to load the 'google/api_client'

Whenever I try to execute the bundle exec ruby analytics.rb I get the error:

analytics.rb:3:in `require': cannot load such file -- google/api_client (LoadError)
    from analytics.rb:3:in `<main>'

I've already installed the google-api-client gem and the it is also inside the gemfile...

Examples not working with current gem due to missing file_storage.rb

It seems like the file file_storage.rb is missing in the gem (version 0.6.4):

$ls ~/.rvm/gems/ruby-1.9.3-p392@gaspm/gems/google-api-client-0.6.4/lib/google/api_client/auth
installed_app.rb jwt_asserter.rb  key_utils.rb     pkcs12.rb

When I clone the repository and try to run the examples, I get the following error:

drive.rb:17:in `require': cannot load such file -- google/api_client/auth/file_storage (LoadError)
    from drive.rb:17:in `<main>'

Search example?

I'm trying to do basic search. google-search gem no longer works.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.