Google日历ID的最大长度 [英] Google calendar id max length

查看:112
本文介绍了Google日历ID的最大长度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道,Google日历ID的最大长度是多少? 如果我生成一些新的日历,那么它将有52个字符.是52个字符吗?

I would like to know, what is maximum length of Google calendar id? If I generate some new calendar, so it have 52 chars. Is it ever 52 chars?

谢谢您的回答.

推荐答案

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

You can find the answer in the official documentation: 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值".错误说明不是很容易理解,所以错误的长度也是我的第一个想法.

Two last conditions are important too. I tried to create an event with 140-character length, but it failed always with the error "HttpError 400 ... Invalid resource id value." The error description is not very expainable, so the wrong length was my first thought too.

如我所见,从Web接口创建的事件ID的长度为26个字符.例如. "h89br54f22543csaelbvd9bpg8".

As I saw, IDs for events, which are created from Web-Interface have 26-character length. E.g. "h89br54f22543csaelbvd9bpg8".

看来,我试图用大写字符放置ID,这与另一种情况相矛盾.我只是将我的ID改为小写即可,并且可以正常工作.我的示例是:"00000000a261a0d73f0bc4489e041b2cf89de14307003368d9e80b5c214287f8ce52b5f2ce9b000000e73a1500006036a1321a462f4a9efbc0d55b344c120000129689b50000".

Appeared, that I tried to put IDs with upper-case characters, which contradict another condition. I simply swiched my ID to lower case and it worked. My example is: "00000000a261a0d73f0bc4489e041b2cf89de14307003368d9e80b5c214287f8ce52b5f2ce9b000000e73a1500006036a1321a462f4a9efbc0d55b344c120000129689b50000".

第三个条件发生了变化,当我尝试删除后重新创建事件时,它认为是API.该事件在Web接​​口中消失了,但事实证明,调用delete()并没有真正删除它,而是将event ['status']切换为'cancelled'.您可以使用get()重用该事件,然后切换状态,例如回到确认".顺便说一句,我收到了错误消息"HttpError 409 ...请求的标识符已经存在."

The third condition snapped, when I tried to re-create the event after deletion it thought API. The event disappeared in Web-Interface, but it turned out, that calling delete() is not really deleting it, but is switching event['status'] to 'cancelled'. You can reuse the event using get() and then switching status e.g. back to 'confirmed'. BTW here I got the error "HttpError 409 ... The requested identifier already exists."

这篇关于Google日历ID的最大长度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆