Services Plugins FAQs

Google Calendar API issues

Hi all,

I’m currently running through lesson 3 of the “Smart Calendar Booking System Course” and am having trouble initializing the call.

image

This is the response i get.

I’ve followed the link and double checked everything including the header options but I think ive set it up correctly, as per the lesson.

Any help appreicated.

Cheers,

Chris

Hello, @cmccray. Thanks for reaching out.

As the red message notifying - you should initialize the call before it will work. To initialize the call, go to the page where you have the google calendar sign-in workflow, run it with an enabled debugger, and authorize with any of your test google accounts. You should receive the message notifying you that your Google Calendar API call was initialized successfully.

Something like this:

I hope it helps.

1 Like

Hi Kate, thanks for your help.
I checked everything against your video and it all checks out, see attached.


I still get the same error message as my first post when i hit initialize.
I’ve spent a few days periodically trying to get this to work but am struggling. Is there something else you can think of that I may have missed? My next step is to try build this in a fresh project and start the course again which I’d rather avoid for now but if it comes to it.

I appreciate your help.

Cheers,

Chris

@cmccray,

I can advise you to refresh the secret key and try to initialize the call again with the new key. How to do that - go to your google dev console, find the project (google calendar that you have created for this course), go to Credentials, hit EDIT on your OAuth 2.0 Client IDs key, and hit the “Reset secret” button:

Don’t forget to hit the “Save” button after you reset your secret. Paste the new secret key into the API call (App Secret), and initialize the call, just like I have shown it in my video.

That can be a good point because sometimes to “fix” the API connector call, you need to remove it and just recreate it from scratch. Try to remove everything from the API connector and re do it again.

I hope it helps.

Edit: I was able to fix it by reseting the secret, as advised. But if someone could explain why these issues can happen, would be awesome.

Hi, I am having the exact same problem. Were you able to solve it? If so, I would really appreciate it if you could share the details.

I have followed the tutorial and executed the API call. It worked and then after a break (lunch), I came back and couldn’t run it again and started getting the exact same authorization error.

I saw the suggestion from @kate about resetting the secret or restarting with a fresh project - but would be great to understand the root cause, given this is a big issue if happens with your app in production.

Thanks in advance.

1 Like

I’m away for work at the moment so haven’t had a chance to work on this yet, will likely try again in the new year or in the period between xmas and new year. I’ll let you know how i go, i’m excited that resetting your secret key worked, hopefully the same for me.

Chris

1 Like

Had another play and reset the secret with no luck.
I’ll create a new project and have another go over the next few days and update.

Chris

Hey @claretimus,

It happens because the token lifetime is very short and it expires almost immediately after you make any changes in your bubble app. It is possible to extend the token expiry time in the Google Developer Console:
Using OAuth 2.0 to Access Google APIs | Google Identity

Unfortunately, there is no other way to make it work longer to prevent throwing the “token expired” alert.

Take care and happy holidays! :confetti_ball:

Hi all, sorry for the delay in my reply.

Had another shot at this, did the course from scratch in a brand new project. Still getting the same result.

Ive thrown fresh secret keys at it as well but to no avail.

I did initially get it to this point, which was a huge win:

It was missing key data, but i was able to initialize the call. However as soon as i clicked off of it and doubled checked my api connector and settings, it went back to throwing the original error, despite me changing nothing. Is there something in the background that could be amiss? I’ve checked everything but I just cant fault what’s going wrong.

Again, any help appreciated.

Regards,

Chris

@cmccray, please accept my apologies for such a late reply :pray:

Let me please check the details of your request, and I get back to you asap. Thanks for understanding.

Regards,

@cmccray,

As I have said in the previous replies, the Google Calendar tokens are expiring quite fast. Even when you refresh your app - the API call in the API connector starts displaying the alert message that your token is not valid anymore.
A solution here - reinitialize the API call the way Bubble suggests you:


Yup, it’s a result. But to make the call display all needed data types, you need to make sure your JSON query contains the correct info. I hope my video record will help you.

Regards,

UPDATE: Undid some changes and got the auth to work again. Now on lesson 5, I keep getting this issue:
There was an issue setting up your call.

Raw response for the API
Status code 400
{
“error”: {
“errors”: [
{
“domain”: “global”,
“reason”: “required”,
“message”: “Missing end time.”
}
],
“code”: 400,
“message”: “Missing end time.”
}
}

Here’s my JSON body and I can’t see any issue. Any idea?

{
"summary": "<summary>",
"location": "<location>",
"description": "<description>",
"start": {
	"dateTime": "<startdatetime>",
	"timeZone": "<starttimezone>"
},
"end": {
	"dateTime": "<enddatetime>",
	"timeZone": "<endtimezone>"
},
"attendees": [
    {"email": "<user1email>"}, 
    {"email": "<user2email>"}
 ],
"reminders": {
	"useDefault": true
}
}
1 Like

@rod.danan,

Please check my settings and compare them with yours. Also, sometimes it helps to simply re-do the API call:

I hope it helps.

Same here!!! Were you ever able to resolve this?

I ended up following this post from Bubble’s forum on how to create your own Google API connector. Worked more efficiently more me and then I just set up the specific functionality I needed for the Google Calendar API.

1 Like