WEB_HOOK channel unavailable when trying to retrieve Google calendar events - heroku

I'm trying to use Push notifications for Google Calendar
Callback endpoint is hosted on Heroku. appname.herokuapp.com is verified in Search Console and added to Google Console APIs & Services Allowed domains list.
Request
POST /calendar/v3/calendars/CALENDAR_ID/events/watch HTTP/1.1
Host: www.googleapis.com
Authorization: Bearer TOKEN
Content-Type: application/json
{
"id":"1",
"type": "web_hook",
"address":"https://APPNAME.herokuapp.com/change"
}
Response
400 Bad Request
{
"error": {
"errors": [
{
"domain": "push",
"reason": "channelUnknown",
"message": "WEB_HOOK channel unavailable for:
{address=https://APPNAME.herokuapp.com/change}"
}
],
"code": 400,
"message": "WEB_HOOK channel unavailable for: {address=https://APPNAME.herokuapp.com/change}"
}
}
What
WEB_HOOK channel unavailable
error means?
EDIT: same result with a top level domain which certificate's Subject matches exactly the domain name.

It appears that this was a temporary issue and is now fixed according to Google. (I also tested and seems to be working for me, now.)

Related

Get the full list of my own YouTube channel's subscriber

I am trying to get the full list of my own channel's subscribers, but this does not work.
https://www.googleapis.com/youtube/v3/subscriptions?part=snippet&mine=true&key=[API_KEY]
I am following the official documentation https://developers.google.com/youtube/v3/docs/subscriptions/list
But get this error
{
"error": {
"code": 401,
"message": "The request uses the \u003ccode\u003emine\u003c/code\u003e parameter but is not properly authorized.",
"errors": [
{
"message": "The request uses the \u003ccode\u003emine\u003c/code\u003e parameter but is not properly authorized.",
"domain": "youtube.parameter",
"reason": "authorizationRequired",
"location": "mine",
"locationType": "parameter"
}
]
}
}
Currently you are only using an api key which will only give you access to public data, using mine is private user data and will require authorization.
This can be seen in the documentation page for
Subscriptions: list States
This means that you must be authorized using Oauth2 to access the subscriptions for this channel. You will then have an access token that you can send as an authorization header bearer token.
GET https://youtube.googleapis.com/youtube/v3/subscriptions?part=snippet&mine=true&key=[YOUR_API_KEY] HTTP/1.1
Authorization: Bearer [YOUR_ACCESS_TOKEN]
Accept: application/json

Problem with create team with Microsoft Graph Api

I have a problem with creating teams using the Microsoft Graph Api. I can get/create groups but when I try to get/create teams I get an error. I'm using postman and the group has owners and members, just as the documentation of MS, also has the permissitions it asks for groups. If somebody can help me, cause I look everywhere for a same error but no found it.
PUT https://graph.microsoft.com/v1.0/groups/{id}/team
Headers: Authorization: bearer token and content-type: json
Body is
{
"memberSettings": {
"allowCreateUpdateChannels": true
},
"messagingSettings": {
"allowUserEditMessages": true,
"allowUserDeleteMessages": true
},
"funSettings": {
"allowGiphy": true,
"giphyContentRating": "strict"
}
}
I always get the same error
{
"error": {
"code": "BadGateway",
"message": "Failed to execute backend request.",
"innerError": {
"request-id": "45eeba8a-9d35-45e8-b42e-c60da7a47dde",
"date": "2020-01-23T21:55:44"
}
}
}
According to the Graph API docs for this, you're not calling the correct endpoint to create a new Team. It should be
POST https://graph.microsoft.com/beta/teams
and a payload similar to
Content-Type: application/json
{
"template#odata.bind": "https://graph.microsoft.com/beta/teamsTemplates('standard')",
"displayName": "My Sample Team",
"description": "My Sample Team’s Description",
"owners#odata.bind": [
"https://graph.microsoft.com/beta/users('userId')"
]
}
Note that it's slightly different, as per the docs, whether you're using delegated versus application permissons.

How to send a proactive message from a bot to a user

I am trying to send a message from a bot to a teams user who hasn't already installed the bot and doesn't need to install the bot via REST API.
I have tried following this document.
It clearly states:
"Sending a message to start a new conversation thread is different than sending a message in response to an existing conversation: when your bot starts a new a conversation, there is no pre-existing conversation to post the message to. In order to send a proactive message you need to:"
As far as I understand, this means that what I am trying to do is possible. I have tried to run this sample.
However, as far as I can tell it needs a conversation id. Without a conversation id it doesn't work.
I have tried to send a request like this with a bot network token ( which is normally used to respond to an activity request by the user):
POST /v3/conversations
{
"bot": {
"id": "28:10j12ou0d812-2o1098-c1mjojzldxcj-1098028n ",
"name": "The Bot"
},
"members": [
{
"id": "29:012d20j1cjo20211"
}
],
"channelData": {
"tenant": {
"id": "197231joe-1209j01821-012kdjoj"
}
}
}
However, it fails with the following message:
Send Message to https://graph.microsoft.com/v3/conversations failed: (401) {
"error": {
"code": "InvalidAuthenticationToken",
"message": "Access token validation failure. Invalid audience.",
"innerError": {
"request-id": "92922235-8c87-47ed-92bc-4ba17469611a",
"date": "2019-09-24T14:43:59"
}
}
}
I am guessing that this maybe because I didn't send MicrosoftAppCredentials.TrustServiceUrl first. But this is a c# call. How do I make the same call in REST API?
Please take a look at Bot Framework REST APIs documentation.
Here are steps to generate the access token which you could use to call Create Conversation APIs.
POST https://login.microsoftonline.com/botframework.com/oauth2/v2.0/token
Host: login.microsoftonline.com
Content-Type: application/x-www-form-urlencoded
grant_type=client_credentials&client_id=MICROSOFT-APP-ID&client_secret=MICROSOFT-APP-PASSWORD&scope=https%3A%2F%2Fapi.botframework.com%2F.default

Getting 403() error while using google Youtube API

I am gating this Error when i use Youtube API
{
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "ipRefererBlocked",
"message": "The request did not specify any referer. Please ensure that the client is sending referer or use the API Console to remove the referer restrictions.",
"extendedHelp": "https://console.developers.google.com/apis/credentials?project=************"
}
],
"code": 403,
"message": "The request did not specify any referer. Please ensure that the client is sending referer or use the API Console to remove the referer restrictions."
}
}
and 403() error it's showing in console

Do Google API keys work for Prediction API?

I am trying to use a Server API Key following the instructions at https://developers.google.com/console/help/new/#generatingdevkeys
I have generated a key and whitelisted my IPs (tried from two different ones so far).
However, every response I send results in 401 Unauthorized. My HTTP request looks like this:
Request from an IP associated with the key
POST https://www.googleapis.com/prediction/v1.6/projects/652546152834/hostedmodels/website/predict?key={MY_API_KEY_IS_HERE} HTTP/1.1
User-Agent: Fiddler
Host: www.googleapis.com
Content-Length: 0
Response
{
"error": {
"errors": [
{
"domain": "global",
"reason": "required",
"message": "Login Required",
"locationType": "header",
"location": "Authorization"
}
],
"code": 401,
"message": "Login Required"
}
}
Am I missing a step? I'd prefer not to use OAuth since it seems like overkill for my simple scenario, but I'll do that next if there's no solution here.
Your application must use OAuth 2.0 to authorize requests. No other authorization protocols are supported.
Source

Resources