简体   繁体   English

Google Calendar API - 通过电子邮件创建和共享

[英]Google Calendar API - Create & Share via email

All the old questions are 3-8 years out of date.所有的旧问题都已经过时了 3-8 年。 Need help with V3 of Google calendar API.需要谷歌日历 API V3 的帮助。

  1. I don't get how to specifically invite an email to the calendar from this documentation: https://developers.google.com/calendar/v3/reference/acl我不知道如何从本文档中专门邀请电子邮件到日历: https : //developers.google.com/calendar/v3/reference/acl

I see how to set the share permissions of the selected calendar, but where do we put the email that we want to share to??我看到如何设置所选日历的共享权限,但是我们要将要共享的电子邮件放在哪里??

so i guess that you want to share your calendar with an email, this is my working code in python:所以我猜你想通过电子邮件分享你的日历,这是我在 python 中的工作代码:

    #ACL INSERT add partecipant to a calendar
    def update_calendar_by_adding_partecipant_to_a_calendar():
        id = "mail@gmail.com"
        url = "https://www.googleapis.com/calendar/v3/calendars/"+ id +"/acl"

        payload = {
                  "role": "reader",
                  "scope": [{ 
                    "type": "user",
                    "value": "mail@gmail.com"
                  }]
        }

        response = requests.request("POST", url, headers=headers, data=json.dumps(payload))
        json_response = response.text
        json_share=json.loads(json_response)
print(json_share)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM