OAuth2 flow in Pythhon flask server

I followed the instruction in the readme.md and setup.md of the quickstart-python

I can get the basic email integration app to run smoothly, I think that my problem is around OAuth process.

  • I ran the server locally and used the tunneling service to expose the local service.
  • Under feature details I enabled the Authorization URL checkbox and set the Auth url to /auth
  • I redirected URL’s to the following URL: https://xxxx-xxxx.apps-tunnel.monday.app/auth/monday/callback (the url provided when tunnel was created)
  • I created custom action, set the workflow blocks, defined sentence for action, provided relative path to the action in the API (/mail/send), created a recipe.

When I try to add the integration to my board, I see the following log in my flask server:

127.0.0.1 - - [18/Sep/2024 20:07:56] “GET /auth?token= HTTP/1.1” 308 -

It stuck for about a minute and than I get spam with:

127.0.0.1 - - [18/Sep/2024 20:12:48] “POST /logs HTTP/1.1” 404 -

Under the consts.py I added the following:

class SecretKeys:
    MONDAY_SIGNING_SECRET = <signing secret under the app basic information>
    MONDAY_OAUTH_CLIENT_SECRET = <client secret under the app basic information>


class EnvironmentKeys:
    MONDAY_OAUTH_CLIENT_ID = '<client id under the app basic information>'
    MONDAY_OAUTH_TOKEN_PATH = '<Didn't know what this value should be>'
    MONDAY_OAUTH_BASE_PATH = 'https://auth.monday.com/oauth2/authorize?client_id=<my_client_id>'

I guess I’m missing something here, really appreciate the community help, thanks in advance!

Funny, I’ve been struggling with this problem today for many many hours, before I bumped into this month old post: Monday-code python quickstart local dev - #5 by Matias.Monday
Tl;Dr - the Python code wouldn’t work locally with Monday. Not sure why they haven’t explicitly written it in the documentation.

If you’re looking to send an email, you may want to dive into the Python code (services\mail_service.py) - I suspect it doesn’t work either. If you do find a method for email sending from Monday code without using an external email service, I’d be happy to hear about it too.

Hi Razido,

I appreciate your comment. I saw this post as well today, and like Matias, I managed to get the quick start guide with the mock email service working only with Monday’s code. It seems many developers are frustrated about not being able to work locally with the Python server, so I’m considering posting a feature request—who knows, maybe the Monday team will take it on! :slight_smile:

As for email integration, you might already know this, but Monday offers built-in integration with basic functionality that could meet your needs.

Thanks for your response.
I wasn’t actually able to find a way to send an email from Monday, and currently forced to ask the user to allow access to their Gmail account. Did you manage to simply send an email from Monday app code without using an external mail server?

I haven’t had the chance to work with an email integration yet. Have you tried this?

These are the Monday built integrations,
I’m not sure it helps in developing Monday code for automation. But will look into it, thanks!