How do you set a Calendar ID when inserting in Google API?

你说的曾经没有我的故事 提交于 2019-12-23 11:54:06

问题


When using the test API in Google's documentation for calendar.calendars.insert I always get back Invalid resource id value. as a response when setting the request like this

{
    "summary": "Events",
    "description": "This is where you will keep your events",
    "id": "test.events"
}

The documentation says that the id can be any string as long as it doesn't have two consecutive dots and it is longer than 0 and shorter than 101.

What am I doing wrong? I would like to be able to set the id so I don't have to store the id that has random characters in my database.


回答1:


You don't set the calendar ID Google Assignes it a Calendar id.

I would assume a Calendar IDs is a primary key and there for must be unique. Google cant allow you to insert your own because then they would have to assume that every programmer bothered to check first that they didn't have one with that ID already.



来源:https://stackoverflow.com/questions/23798152/how-do-you-set-a-calendar-id-when-inserting-in-google-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!