I want to deploy a Python backend to Monday Code that talks to the Monday API (specifically for doing GraphQL mutations). I want to use the OAuth Flow because I want to make API calls in the background for an extended period of time and without user input. I would also like to make it publicly distributable.
I have a working prototype that uses a combination of the Workspace view feature and talks to a locally hosted (on my machine) copy of the backend. The Python backend on my machine gets the API key (or token) from an environment variable.
Obviously this approach won’t work for a publicly distributable app (storing the API key in an environment variable).
The documentation says that "After a user approves or denies your app’s authorization request, they will be redirected back to your app’s specified redirect_uri’. How do I test this?
The documentation also says “Your app makes an authorization request and redirects the user to the monday OAuth URL with the client ID.” What part of the “app” is making this request and when?
My last question is what is the best code example of this sort of setup that I can follow. Doesn’t have to be in Python but it would help.
You can find a full example on how to use OAuth with monday here
The OAuth screen this is referring to is the one you see in the app’s configuration page, in the OAuth section, under “Redirect URLs”, where it says “Making OAuth request”. When you show that to an account where the app is installed, they will see the OAuth scopes authorization screen. When a user clicks on “Authorize”, the OAuth flow will start as explained here and shown in the Github example above.
When do the OAuth process will be triggered?
In the github link you attached, it says: “When a user navigates to the homepage URL” When the user does that? I believe it should be part of the installation process, right?
If so, how do I trigger it? with the autorization_url in the app settings?
When the OAuth scopes authorization screen is shown will depend on you.
If you have an app that has an integration feature, you can add the URL from your OAuth tab from your app as part of your authorization URL and then it would be shown before the recipe is added to a board!