Zoho Inventory Oauth2 404 Error

Hello. I’m trying to create an Oauth2 connection (http node) for Zoho Inventory but right after the permissions page, it goes to 404 error. On zoho, a server-based client credential was created & details from there were added but the connection was not successful.

The url does give the one-time code (valid for 60seconds) with the url of the request. I’m thinking, n8n should be using that to get the access token (valid for 1H) & the refresh token–with new access token generated once a request fails. Is this not the case? Do I have to do a manual loop?

ex. oauth2

Any inputs would be very much appreciated.

Edit: This is the flow that’s in the plan:

Using:
Desktop App 0.174.0

Hi @jay, this is an error coming from Zoho and I am not familiar with their authentication unfortunately. Do you have any link where they explain how their tokens are renewed or how to get a long lived token?

That makes sense. I had tried oauth2 with integromat & over there, the issue was that it wasn’t renewing/regenerating access token with the given refresh token but the connection was successful (for 1H).

Their token specifics are within their oauth documentation here:
https://www.zoho.com/inventory/api/v1/oauth/#overview

As far as the documentation goes, there is no long-lived option.

1 Like

Thanks for the link, I’ll play around with this when I find some time.

In the meantime, could you try setting the Authentication field value to Body rather than Header? That’s what the built-in Zoho credentials do and I wonder if that might already make a difference.

Sounds good. Thank you.

In the documentation, it mentions the use of header but I just tried body & it still results in 404.

Edit: Is it possible to overwrite the initial auth uri params? So I could get the access_token & refresh_token (postman) and then pass them as params through n8n.

Hi @jay, just a quick update on this one I could authenticate with these settings:

Nothing special on Zoho-side, apart from having the multi DC option enabled:

The authentication definitely lasts longer than 60 seconds, but I am not sure if the renewal after each hour works yet. I have added a Cron node to my example workflow running every 15 minutes and will check later today if it’s still working.

Okay, these settings are looking good so far. No auth problems after a couple hours:

I’ll check this once again on Monday, but you can probably give the settings from my previous post a go already @jay.

Good news, the above is still working :slight_smile:

So the renewal seems to work okay using this approach. However, one thing that came to mind here was your use of the desktop app @jay. Do you have it closed for longer periods of time by any chance (for example because it’s running on an actual desktop machine that’s turned off outside of working hours)?

If so the token renewal might fail (because the refresh token no longer works when your instance comes back online. You might want to consider hosting n8n on a server or use n8n.cloud rather than your desktop to avoid hitting that problem.