这个问题已经被问过一段时间了,但还没有得到解答。我认为从那以后事情已经发生了变化。
我可以使用 API 创建事件,但无法将颜色设置为默认值以外的任何颜色。这是:colorId 不起作用?有什么想法吗?
event = Google::Apis::CalendarV3::Event.new({
:summary => @measure.value,
:description => 'created by ' + current_user.username,
:start => {
:date_time => event_starttime
},
:end => {
:date_time => event_endtime
},
:colorId => "6"
})
最佳答案
我刚刚遇到这个问题是因为我遇到了同样的问题。我正在使用 ruby api 客户端,并深入研究了它的 code找到这个:
# The color of the event. This is an ID referring to an entry in the event
# section of the colors definition (see the colors endpoint). Optional.
# Corresponds to the JSON property `colorId`
# @return [String]
attr_accessor :color_id
更新我的事件插入调用以使用 color_id: 'a number from 1 to 11'
对我有用。
关于api - 如何使用 API 设置 Google 日历事件的颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44342708/