Google Calendar Integration - Unable to authenticate with API: 401, message='Unauthorized' Home Assistant - google-calendar-api

Not sure what is going on, but after following some instructions here to integrate my google calendar into Home Assistant, it works for like an hour, then it doesn’t work anymore. Tried it 4 times, both times just stops working with Google calendar after about an hour, even after delete the project from google and making a new one.
Here's the error log:
Unable to connect to Google: Unable to authenticate with API: 401, message='Unauthorized', url=URL('https://www.googleapis.com/calendar/v3/calendars/f...[]....75#group.calendar.google.com/events?maxResult=100&singleEvents=true&orderBy=startTime&fields=kind,nextPageToken,nextSyncToken,items(id,summary,description,location,start,end,transparency)&timeMin=2022-05-01T06:00:00%2B00:00&timeMax=2022-06-12T06:00:00%2B00:00')
3:34:54 PM – (ERROR) Google Calendars - message first occurred at 3:34:24 PM and shows up 48 times.
when it happens, I click on calendar and its just a blank calendar, when it was previously showing all my entries.
Any idea why it works and then it doesn’t work?

The method you are currently trying to use requires user consent. You will need to use Oauth2 to request consent of the user and get an access token back. This token will allow you to access the users data. You are not currently sending one. It is sent as an authorization header.
GET https://www.googleapis.com/calendar/v3/calendars/[CALENDARID]/events?key=[YOUR_API_KEY] HTTP/1.1
Authorization: Bearer [YOUR_ACCESS_TOKEN]
Accept: application/json

thanks!
Turns out there was some server issues at Google. Problem resolved itself after a couple of days.

Related

Here.com Destination Weather API returns "Forbidden" "These credentials do not authorize access"

Using the Here.com Freemium account, previously I was using the example here with my own API Key and some modifications to get the 7 day forecast. Based on this command, I had some code running in my back-end server every 2h collecting data, which ran for about a week without problems. I have not touched the code since then.
After a week, it stopped working.
Now, even when I generate a new API key, and use the same command, I get the following return data in Postman:
{
"error": "Forbidden",
"error_description": "These credentials do not authorize access"
}
Is my account restricted? It doesn't say anything about it in my Project page:
Without doing anything, suddenly it started working again, and on Oct. 1st.
I suspected I was being throttled, but when I tried using the service on a separate account, that also didn't work. So it seems likely the service was down. I wish there was some news page that posted what the status was?...
On developer.here.com you can look up the status of the services. I did this and don't see a reported problem for the Weather API for the last days.
My suggestion is that you missed to verify your email address after registering for your account. You still can do this at any time through clicking on the link that you received in an email from developer portal after your registration.

LinkedIn Sign In API recently intermittently failing

I'm having intermittent issues with signing in to LinkedIn with the LinkedIn Sign In API.
By intermittent I mean, I have two LinkedIn accounts, and as of this week one of them is unable to use the API to sign in to external services, such as the LinkedIn application I develop.
I'm authenticating via Auth0, whose engineers have confirmed there is an issue:
Over the last few weeks, the current version of the LinkedIn API for
sign-in has been intermittently failing when fetching the user
profile, causing a small number of users to fail to log in. The cause
of this issue is currently unknown, and is coming from LinkedIn
directly.
https://community.auth0.com/t/linkedin-connection-deprecated/20484/18
The Auth0 response i'm getting is the following (I've replaced senstivie response values with 'XX'):
{"name":"a0.response.invalid","message":"unknown error","json":{"error":"invalid_request","error_description":"InternalOAuthError: failed to fetch user profile (status: 500 data: {\n \"errorCode\": 0,\n \"message\": \"Internal API server error\",\n \"requestId\": \"XX\",\n \"status\": 500,\n \"timestamp\": 1550474289966\n})","state":"XX"},"status":0}
I know this API is being depreciated in March, but it's imperative that this API continues to work until the decommission date. I'm wondering if anyone has found a work around or solution to this issue, as it's impacting my ability to run real-world trials of my application scheduled in this week.
I've contacted LinkedIn support who directed me here.
Auth0 recently released a change to LinkedIn social connection, allowing you to use the new LinkedIn API (Version 2). You can change this by going to Connections-->Social-->LinkedIn-->Strategy Version dropdown and select Version 2. This should fix most of the login issues with the old deprecated version of LinkedIn API. More information post.

Google doesn't send Push-Notifications

I'm using Google Calendar API in my application.
The problem that I faced is that Google doesn't send me Push-Notifications.
I setup my app here https://console.developers.google.com/
Verified domain: https://console.developers.google.com/apis/credentials/domainverification
Watched calendar: https://developers.google.com/calendar/v3/reference/calendarList/watch and got successful response.
However, having done all of this, no push-notifications are received by my web-hook. It seems that Google just doesn't send them. Maybe I missed some step? I use https URL.
The problem was that the URL that I used for PUSH-NOTIFICATIONS wasn't whitelisted and if it was requested from other network(e.g. Google), then the request couldn't be processed.
Therefore, if there is such a problem, consider checking your URL availability outside your network. It should be accessible from anywhere and by anyone.

gapi.auth2.getAuthInstance().isSignedIn.get() is always false when Chrome Browser has multiple accounts

I copied the example given in Google Calendar API Quickstart and replaced it with the appropriate info. Every time I refresh the page, I'm asked to authorize before api data is fetched.
I'm using Chrome and I currently have multiple accounts / users. I noticed if I open an Incognito Window and sign in with one set of credentials then when I refresh the page I'm not asked to authorize.
Note, once I authenticate I receive calendar information so I don't believe it's an issue with client_id, api_key, scope, etc.
Looking at the example code, I'm guessing the getAuthInstance() is getting confused because of multiple accounts / users. Does anyone have any idea? Thanks!
This was happening when running on localhost. This issue stopped happening after deploying the webpage to a hosted server.

google calendar api "try it" examples broken?

I've been trying to get the Google PHP API working to add events to my calendar, but I keep getting POST errors, So i went to the docs on their site, but their live onpage examples of the API's keep giving me 500 errors, does anyone know why?
Like this one:
https://developers.google.com/google-apps/calendar/v3/reference/events/list#try-it
All you need to pass is a calenderID and auth with the google calendar scope, I did both of those and hit execute and I get a 500 internal server error from Google.
Are the Google Calender API's just broken or what?

Resources