edgi-govdata-archiving / edgi-hubot-halpy

Heroku-backed chatbot-friend who lives in EDGI Slack
https://edgi-hubot.herokuapp.com/
3 stars 0 forks source link

Add command to allow invitation to EDGI gcal from chat #30

Closed patcon closed 5 years ago

patcon commented 6 years ago

Got the working from API explorer, so just need to get it into a hubot command so that we can all share calendar access much easier.

> patcon: @halpy add gcal user xxxxx@gmail.com
# in ruby
rule = Google::Apis::CalendarV3::AclRule.new(
  scope: {
    type: 'scopeType',
    value: 'scopeEmail',
  },
  role: 'role'
)
result = client.insert_acl('primary', rule)
print result.id

calendarId: ekvdm17nis4qd2j4h4djrdfvh0@group.calendar.google.com

{
  "role": "writer",
  "scope": {
    "type": "user",
    "value": "xxxxxx@gmail.com"
  }
}

Here's the lib we'd need, which apparently works similarly to ruby example: https://github.com/google/google-api-nodejs-client

patcon commented 6 years ago

https://developers.google.com/google-apps/calendar/v3/reference/acl/insert#try-it

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in seven days if no further activity occurs. If it should not be closed, please comment! Thank you for your contributions.