0

这是我的代码:

oauth_yaml = YAML.load_file('google-api.yaml')
client = Google::APIClient.new
client.authorization.client_id = oauth_yaml["client_id"]
client.authorization.client_secret = oauth_yaml["client_secret"]
client.authorization.scope = oauth_yaml["scope"]
client.authorization.refresh_token = @rtoken
client.authorization.access_token = @token

if client.authorization.refresh_token && client.authorization.expired?
  client.authorization.fetch_access_token!
end

service = client.discovered_api('calendar', 'v3')
result = client.execute(
  :api_method => service.events.list,
  :parameters => {'calendarId' => @calendar, 'start-min' => Time.now.xmlschema},
  :headers => {'Content-Type' => 'application/json'}
)

@parsed = JSON.parse(result.data.to_json)

无论是否包含“start-min”参数,我都会收到所有事件。我在这里做错了吗?

谢谢。

4

1 回答 1

0

正确的参数其实是timeMin,而不是start-min。

于 2013-05-13T19:32:58.693 回答