2013-05-05 62 views
0

這是我的代碼:谷歌日曆API「開始分鐘」參數沒有做任何事情

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) 

我得到的所有事件,無論是否包含在「開始分鐘」參數與否。我在這裏做錯了什麼?

謝謝。

回答

0

正確的參數實際上是timeMin,而不是start-min。