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

时间:2018-10-26 01:48:58

标签: google-calendar-api

所有旧问题已过期3-8年。需要有关Google Calendar API V3的帮助。

  1. 我不知道如何从以下文档中特别邀请电子邮件发送到日历:https://developers.google.com/calendar/v3/reference/acl

我看到了如何设置所选日历的共享权限,但是我们要将要共享的电子邮件放在哪里?

1 个答案:

答案 0 :(得分:0)

所以我想您想与电子邮件共享日历,这是我在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)
相关问题