Monday APIv2 API-Token per User

Dear Monday-Community,

I´m neewbie in working with the Monday-APIv2 so far.
Therefore I will ask my newbie question as well :wink:

I´m working for a company where we are already working with about 5 Monday-Accounts.
For my further project I would like to show up each boards per User on our own Website.
We have already all that Users SignedUp on our own Website.
Next step should be to generate the API-Token for every User, so that each User will have his own API-Token which will refer to his Boards when LoggingIn to our Website.

My Question:
Where can I generate the API-Tokens for each User?
So far I have only find this Option for my Monday-Admin-Account but not for the other Users.

Thank you in advance and have a nice day!
Max

Hey @max91 – welcome to the developer community!

There are a couple of ways to generate an API token for a given user:

  1. Using the OAuth2 protocol. You can set up a monday App (link to docs) and use our SDK to let each user authorize your project separately. Check out the documentation for our OAuth implementation here. You can also see a simple code example using the OAuth flow here.

  2. Asking each user for their API key. Each user can access their tokens in the monday apps section. This is not recommended because of the manual work, but is an option. To do this, they need to first activate “monday apps” in the monday.labs section of their account (link to article). Then, they will be able to get their tokens in the “My Tokens” tab of the developers section:

1 Like

Hello @dipro-monday.com ,

thank you for your support!
I guess the best decision for me would be number one.
Therefore I tried to set up the github sample you have recommended.

Setting everything up (nodejs, monday-app, permissions and so on) was working fine.
Unfortunatelly I do not understand the reason for using the ngrok-tool.
Can´t I just connect my website with my monday app with oauth2 without ngrok?

Furthermore I do not understand what kind of url i should set up for the redirect url.
What should the redirect url look like?
I tried a existing URL of my localhost (http://localhost/monday-oauth-example-master/public/finish.html) but I received the error message:
|error|“invalid_request”|
|error_description|“Invalid redirect_uri”|

Thank you in advance!
With kind regards,
Max

Hey @max91,

the whole purpose of ngrok is expose your localhost to a public URL.
In other words, monday.com gets a connection to the machine you are running ngrok on.

First install ngrok.

Then open your console and enter:

ngrok http 3000

“HTTP” stands for the protocol you use and “3000” is the port you will expose by executing this command.

Next up your console will display something like this:

The HTTPS URL is the one you want to copy and paste/use.

Hope I could help you.

Greetings.

1 Like

Hello together,

thank you for your support!
I have tried running the sample now with ngrok and nodejs.
I get the index.js running on the npm and start up ngrok with localhost on port 3000.
If I navigate to the ngrok https-link,
it is loading the correct Start Page including the Start Button.
Unfortunatelly when clicking on it I receive the following invalid request error:
|error|“invalid_request”|
|error_description|“Invalid redirect_uri”|

I think I have to fix some configuration on the monday app but I´m not sure.
Can you tell me which link I need to configure for redirect?
In the ngrok console I receive a error message for:
Get /favicon.ico 404 Not Found

With kind regards Max

Hey @max91!

The redirect URI must match the URIs that you have set up in your app. To check which URIs are valid, go to your app > OAuth & Permissions > Redirect URIs.

If you’re using ngrok, you might need to change this configuration each time you generate a new ngrok tunnel (since each one has a unique URL).

Let me know if that helps!