Zoho Workdrive API Integration

Hello fellow developers,

I’m currently working on integrating Zoho WorkDrive with a Bubble.io application using the OAuth 2.0 User-Agent Flow. I’ve encountered a few issues during the setup and testing phase, and I’m hoping someone here might have some insight or solutions.

Setup Details:

API Name: Workdrive

App ID: [CLIENT_ID]

App Secret: [APP_SECRET]

Scope: WorkDrive.files.CREATE, WorkDrive.files.READ, WorkDrive.files.UPDATE, WorkDrive.teamfolders.READ

Redirect URI: https://your-domain.com/api/1.1/oauth_redirect

OAuth URL: https://accounts.zoho.com/oauth/v2/auth?client_id=[CLIENT_ID]&response_type=code&access_type=offline&prompt=consent&scope=WorkDrive.files.CREATE%2C%20WorkDrive.files.READ%2C%20WorkDrive.files.UPDATE%2C%20WorkDrive.teamfolders.READ&redirect_uri=https%3A%2F%2Fyour-domain.com%2Fapi%2F1.1%2Foauth_redirect%3Fdebug_mode%3Dtrue&state=%257B%2522debug_mode%2522%253A%2522true%2522%252C%2522oauth_provider%2522%253A%2522apiconnector2-XXXXX%2522%252C%2522resume_key%2522%253A%2522RESUME_KEY%2522%252C%2522used_redirect_url%2522%253A%2522https%253A%2F%252Fyour-domain.com%252Fapi%252F1.1%252Foauth_redirect%253Fdebug_mode%253Dtrue%2522%257D

Issues Encountered:

Redirect ID Invalid Error: Initially, I was getting a “Redirect ID invalid” error, which I believe was due to a mismatch in the redirect URI between my Bubble setup and what was registered in Zoho. I’ve since corrected this to https://your-domain.com/api/1.1/oauth_redirect?debug_mode=true.

Generic Error from Zoho: After resolving the redirect URI issue, when I attempt to authenticate, I’m now facing a generic error from Zoho: “An error occurred while processing your request. Please try again later.” This error provides no specific details, making it hard to diagnose.

Bubble.io Warning: Bubble.io is warning me that I haven’t tested the API in run mode and authenticated with Workdrive yet. I’ve set up a login workflow as instructed, but when running the app with ?debug_mode=true, the authentication still fails with the generic error.

Troubleshooting Steps Taken:

Verified the redirect URI in Zoho Developer Console.

Updated the OAuth URL in Bubble to reflect the correct redirect URI.

Ensured the state parameter is being handled correctly by Bubble.

Tested in different browsers and with cache cleared.

Checked for any server-side or network issues (none found).

Has anyone else encountered similar issues when integrating Zoho WorkDrive with Bubble.io? Any suggestions on how to proceed or what might be causing the generic error from Zoho? Also, any tips on ensuring the OAuth flow works seamlessly in Bubble would be greatly appreciated.

Thank you for your time and assistance!