2015-02-23 23 views
0

我想知道,Google日曆ID的最大長度是多少? 如果我生成一些新的日曆,那麼它有52個字符。它有52個字符嗎?Google日曆ID最大長度

謝謝你的回答。

+0

我不會依賴那個。你爲什麼需要它? – luc 2015-02-23 23:11:45

+0

我需要將它存儲在數據庫中,我需要知道,最多有多少個字符。 – 2015-02-24 07:00:08

+0

也許使用varchar? – luc 2015-02-24 16:17:26

回答

0

你可以找到的官方文檔中的答案: https://developers.google.com/google-apps/calendar/v3/reference/events/insert

* the length of the ID must be between 5 and 1024 characters 
* characters allowed in the ID are those used in base32hex encoding, 
    i.e. lowercase letters a-v and digits 0-9, see section 3.1.2 in 
    RFC2938 
* the ID must be unique per calendar 

最後兩個條件也很重要。我試圖創建一個長度爲140個字符的事件,但總是出現錯誤「HttpError 400 ...無效的資源ID值」。錯誤描述不是很清楚,所以錯誤的長度也是我的第一個想法。

正如我所看到的,從Web界面創建的事件ID具有26個字符的長度。例如。 「h89br54f22543csaelbvd9bpg8」。

出現了,我試圖把ID與大寫字母,這違背了另一個條件。我只是將我的身份證轉爲小寫字母,並且工作正常。我的例子是:「00000000a261a0d73f0bc4489e041b2cf89de14307003368d9e80b5c214287f8ce52b5f2ce9b000000e73a1500006036a1321a462f4a9efbc0d55b344c120000129689b50000」。

第三個條件被捕獲,當我試圖重新創建事件後刪除它認爲API。事件在Web-Interface中消失了,但事實證明,調用delete()並不是真的刪除它,而是將事件['status']切換爲'取消'。您可以使用get()重用事件,然後切換狀態,例如回到'確認'。順便說一句,我得到了錯誤「HttpError 409 ...所請求的標識符已經存在。」