google-api-ruby-client: Batch per-request authentication is ignored

Environment details

  • OS: Ubuntu, linux last
  • Ruby version: ruby 2.4.5
  • Gem name and version: google-api-client ~> .030

Steps to reproduce


  1. events = []
    page_token = nil
    access_tokens = []
    calendar = Calendar::CalendarService.new

    GoogleIdentity.last(2).each do |e|
      access_tokens << e.fresh_token
    end

    calendar.batch do |calendar|
      access_tokens.each do |token|
        calendar.list_events('primary', options: { authorization: GoogleAccessToken.new(token) }, page_token: page_token, q: query, max_results: 2500, time_min: min_date, show_deleted: show_deleted) do |response, error|
          p 'i=' * 10
          p token
          p 'response=' * 10
          p response
          p 'error=' * 10
          p error
        end
      end
    end

The response is

Error - #<Google::Apis::ClientError: dailyLimitExceededUnreg: Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup.>

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 15 (15 by maintainers)

Commits related to this issue

Most upvoted comments

The Sending Batch Requests does say each batched call can have its own Authorization header.