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:

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:

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.

1 Like

I wanted to ask a follow-up question related to this one. I’m fighting the same issue but with Zoho CRM. In my case I have followed the above advice. I’m using the Multi-DC option in Zoho’s API Console and have configured my generic oauth2 credential. I also set up a 15-minute scheduled workflow, and it works ok for the first hour then starts responding with errors afterwards. See example output below.

I’ve parsed out the access token and refresh token values using the nodes as follows. In the condition where there is an invalid token, how can I use the refresh token to reauthenticate and proceed through the workflow?


Hi @hndmn, if you manually refresh an access token and thus circumvent the n8n OAuth2 logic, you’d have to use it in an Authorization header as described here:

Access Token: An end-user authorized key that lets the client access protected resources from the resource server. The client can make API calls using this access token for up to an hour after the creation of the access token.

So you’d want to store this updated token (along with your refresh token), then read it whenever needed and attach it to your HTTP Request in the aforementioned header. Like so I think based on the Zoho docs:

Thanks for this @MutedJam. My preference would be to utilize the n8n OAuth2 logic, but for whatever reason Zoho tokens are not refreshing and expire after an hour, so I need this as a workaround to keep workflows running without any interaction.