我想從我的主日曆中找到所有freebusy時間,但我無法獲得查詢來識別我的參數。谷歌的freebusy API調用不會識別參數
在我的控制,我有:
@freetimes = client.execute(
:api_method => service.freebusy.query,
:parameters => {
'timeMin' => '2013-06-15T17:06:02.000Z',
'timeMax' => '2013-06-29T17:06:02.000Z',
'items' => [{'id' => '[email protected]'}]
},
:headers => {'Content-Type' => 'application/json'})
我得到的迴應是:
--- !ruby/object:Google::APIClient::Schema::Calendar::V3::FreeBusyResponse
data:
error:
errors:
- domain: global
reason: required
message: Missing timeMin parameter.
code: 400
message: Missing timeMin parameter.
不過是表明它採取了參數,但他們並沒有得到重視查詢:
--- !ruby/object:Google::APIClient::Result
request: !ruby/object:Google::APIClient::Request
parameters:
timeMin: '2013-06-15T17:06:02.000Z'
timeMax: '2013-06-29T17:06:02.000Z'
items:
- id: [email protected]
任何幫助解決這個將不勝感激!
我已經解決了它,根據找到的響應[這裏] [1] 哈希需要轉換成JSON正確傳遞不像其他日曆方法。 [1]:http://stackoverflow.com/questions/7455744/post-json-to-api-using-rails-and-httparty – tristantoye