Microsoft graph mail multiple pages

I’m moving away from sengrid due to the fact that a lot of mail is bounced. I am using microsoft graph to send emails through Office365.

I have configured Microsoft Graph via the standard bubble API connector (which works great). I’m sending emails from several different pages using the Graph API. I now come to the conclusion that everytime I send an email from another page I have an incorrect token. When I reregister the application from that specific page it works until… I move to another page and have the same issue.

image

Same goes for example between dev and prod.

Does anyone have an idea how to get around this? I would like to be able to send emails through Microsoft Graph regardless of the page I’m on at that moment.

It seems the issue is a different one. For some reason the access token expires after some time. So I can send emails from different pages trough Office365 without any issues now but after some time (a couple of hours??) the token is expires and I have to request a new one through a Signup/Logon API.

Any chance to get this persistent?

Access tokens expire for safety reasons. When you get an access token, you also get an “expired in” value, which tells you how long the token is valid.

When the token is expired, you have to request a new one by using the refresh token.

What you have to consider: you only get a refresh token if you request the “offline_acces” scope and you are using the “authorization_code” grant flow.

Thanks for your reply! But… I don’t understand what you are saying :slight_smile:

I have the following configuration, should I change something on the scope side?

Ah, it’s on the Microsoft side, I have added this one, should I be fine now?