Flavien / zoho-books-exporter

MIT License
1 stars 2 forks source link

oauth2? #1

Closed focusede closed 2 years ago

focusede commented 3 years ago

Thanks for making this. I am increasingly frustrated with Zoho books as a provider, they are deprecating tokens for Oauth2 and have the worst developers section with zero .net examples. Have you reworked this to work with that?

Flavien commented 2 years ago

I finally got the time to update this to work with OAuth 2.0. To use it, you need to create a self-client on the API console. Then just follow the instructions.

focusede commented 2 years ago

Nice!!! thank you. I had cobbled something together but was not happy with how it worked.

focusede commented 2 years ago

Hey there, This is giving me a 401 when I run it on the US data center. It seems to be doing the token ok. Also, what values should be supplied for the trx type? Lastly, any thought to make this function with a persistent token so you don't have to rerequest each time? My goal for something I create is a continuous integration that pumps out timesheets, clients, projects tasks to SQL tables for reporting.

Flavien commented 2 years ago

I've just pushed an update, the OAuth refresh token is now persisted so next time you run the program, it will use it to get the auth token (so it will not require a code).

On the 401, you need to make sure all the settings in appsettings.json are correctly set. The domain should be zoho.com and the client ID and secret should be taken from the API console.