I am trying to watch some calendar events via API. I am having trouble with getting this to work though. I had been thinking it might have been the library I'm using (https://hex.pm/packages/google_api_calendar)
But I had recently tried using Google oAuth playground to try the same and that had not been working either.
So I think I might not fundamentally understand something about watching calendar events. What am I doing wrong here?
As stated in the documentation of Google Calendar API Events:watch, you have to provide a request body with the following structure:
{
"id": string,
"token": string,
"type": string,
"address": string,
"params": {
"ttl": string
}
}
Further Reading:
Guide: Push Notifications
Related
Is it possible to open an external URL when the user click on FCM push notification on web.
If it is possible can anyone give provide some details on it or any documentation.
Thank you.
I tried firebase documentation and did some research online. There are ways to achieve it in android and ios devices, I think, but could not find anything for web.
I am looking for someone with experience in this or anyone who can provide me with any documentation.
You could use the click_action field which contains the action associated with a user clicking on the notification. Note that for all URL values, HTTPS is required.
Here's a sample for customizing a HTTP v1 message with 'click_action' for Web:
{
"webpush": {
"notification": {
"title": "Fish Photos",
"body": "Thanks for signing up for Fish Photos!",
"icon": "firebase-logo.png",
"click_action": "https://example.com/fish_photos"
}
}
}
I'm going to create a google resource calendar room via its API (i.e. https://admin.googleapis.com/admin/directory/v1/customer/my_customer/resources/calendars). But the problem is, when I create one, it turns into an unavailable (crossed out) room within google calendar rooms and I couldn't find any attribute to make it available!
Here's the body request/response:
{
"kind": "admin#directory#resources#calendars#CalendarResource",
"etags": "\"CTyc505ppdmJR2motHVsU17kzItOkPo5vYViqlSF0rU/FB0b765ZgWIpTBaxn5YQIwZWWNM\"",
"resourceId": "9f698cdc-84f9-4688-95a7-c2207b4fa7ae",
"resourceName": "StackOverflow Test",
"generatedResourceName": "Orangery Hildesheim Nordstadt-EG-StackOverflow Test (3)",
"resourceEmail": "c_1881d77mmcaqsihgi426fseae6vnc#resource.calendar.google.com",
"capacity": 3,
"buildingId": "Orangery-Hildesheim-Nordstadt",
"floorName": "EG",
"resourceCategory": "CONFERENCE_ROOM"
}
Here's the output on google calendar:
After two months finally I found a solution!
In fact, the main problem is related to the lack of permission for those created resources for other users in the organization. To tackle this problem I used another google API named ACL (Access Control Level) ref, to set a privilege for other users. Basically, a google resource actually is a google resource calendar, so you can use ACL API to access that calendar. Moreover, the parameter to reach that calendar is resourceEmail as the unique ID of the respective resource calendar.
Here's the thing I did to make unavailable resources to be available (bookable):
POST https://www.googleapis.com/calendar/v3/calendars/calendarId/acl
change calendarId with the value of resourceEmail of the google resource.
the body of the request:
{
"scope": {
"type": "domain",
"value": "orangery.io" # if you selected type as `domain` you should write your domain name here.
},
"role": "writer"
}
[NOTE]:
With this procedure, you will need to the https://www.googleapis.com/auth/calendar authorization scope as well.
Can bot add a reaction to a user message?
I tried to send an activity like this:
{
"type": "messageReaction",
"reactionsAdded": [{ "type": "like" }],
"replyToId": 1579278444192
}
on this URL - /v3/conversations/{conversationId}/activities/{activityId}
It depends entirely on the channel you are wanting to implement this on. If channel x (Facebook, Slack, etc.) sends "reactions" as part of the activity and the service allows you to scope to it, then it is possible to return bot responses based on those.
The Botbuilder-Samples GitHub 25.message-reaction Javascript sample demonstrates how this is achieved for Teams. The C# version can be referenced here. You would need to adjust the code to look for the appropriate context/activity data points and filter on those to send a response back.
Hope of help!
I'm trying to mute notifications particular group in Slack workspace. Is there any API method available to do?
I've tried using the web-API method mentioned in this GitHub page https://github.com/ErikKalkoken/slackApiDoc/blob/master/users.prefs.set.md.
It causes no error in response but the channels I provided in the 'muted_channels' parameter wasn't muted.
In my case, I didn't have to send a prefs payload as ErikKalkoken described, but instead this one. Found it out thanks to this Tweet: https://twitter.com/slackhq/status/457711460425027584
{
"name": "plain_text_mode",
"value": True
}
I've gone thru lot of documents on it, but didn't find anything helpful.
I'm successfully able to call
https://www.googleapis.com/calendar/v3/calendars//events/watch
api and receiving expected response from watch api.
{ "kind": "api#channel",
"id": "<UUID>",
"resourceId": "<resourceId>",
"resourceUri": "https://www.googleapis.com/calendar/v3/calendars/<emailid>/events?maxResults=250&alt=json", "token": "<tokenvalue>", "expiration": "1524485589000" }
I believe google should start notifying to the address property (host url where we want to get notified), once above channel gets setup. But I don't receive any notification.
Please let me know if I'm missing anything.
Thanks.