Need authorization help using API v2 with Excel VBA

I’ve created an Excel workbook using VBA to update monday using API v2. Currently, I have my own API token as a constant in the VBA project. I want to be able to have other people use the workbook. Obviously, having my token as a constant is not optimal. The other possibility I see is to have the user paste their token into the sheet. I don’t like that they would either have to paste their token every time they opened the workbook or allow them to save it with the token.

My preference would be that the fact that they are logged in on monday would allow them access to the API.

Any ideas?

Hi @JCorrell, Jim

This is where OAuth comes in :slight_smile:. You make an HTTP request to https://auth.monday.com/oauth2/authorize? where you specify a callback. The callback will be called by monday.com with a code. With this code you make another HTTP request to https://auth.monday.com/oauth2/token and you wait for a return from monday.com with a token. In this handshake you can define what your VBA project wants to do with the board (scope) and the user will be prompted to authorize this.

There’s a repository with a simple server to server example usage of the monday.com OAuth functionality in general: https://github.com/yuhgto/monday-oauth-example

See also an article here: https://monday.com/developers/apps/oauth

1 Like

Thanks for the help!

Hi,

I’m looking to do a similar thing from Excel; did you get anywhere with this and have any code you are willing to share?

Thanks,

Stuart

I gave up on the Oauth. I basically went the token route. I added logic to allow user to save their token in an encrypted format that they could then reuse with a password.

If you get it to work without a redirect server, I’d like to see it.

If you are interested in the token logic, let me know.

Hi,

Thanks for the speedy response.

I really would appreciate anything you can share with me. I’m trying to evaluate whether Monday fits our needs and the ability to work with it via the API and Excel is critical.

Cheers,

Stuart