I need help with my Zoho CRM Integration.
I’m working with a client on an app that aspired to bridge the communications gap between freelance insurance agents and their respective clients.
One of the biggest project requirements was to integrate Zoho CRM so that agents can connect their accounts. I managed to get this working. Agents click a button, are redirected to a Zoho page, approve the connect, are redirected back to the app. The connection is made and the user can now call their client’s data from Zoho from within the Bubble app.
But here is where my problem begins.
Zoho API relies on access-tokens and refresh-tokens to maintain the connection. When the access token expires the refresh token can be used to grab a new access token, and so on, creating a seamless experience for the user.
The problem is that I cannot seem to figure out how to extract the access tokens, so the user connections are temporary.
I will go through my setup and hopefully someone can identify the pain point.
Setting Up Zoho API
First thing’s first, in Zoho’s Developer Console, API console, I created a client for the app using the “Server-based applications” option. You must do this to retrieve your Client Secret that you will use later.
Next, you name your client and add some URLs. The Homepage URL for now is the page where the app lives. The Authorized Redirect URI is a generic redirect URL provided by Bubble during the API setup.
Setting up Zoho CRM
To test this integration, I had to sign up for a Zoho CRM account and create clients (contacts) for testing.
Setting up API Connector
Next, I setup the API Connector with these configurations.
This setup is what allows the user to be redirected to the Zoho CRM signin page where they’ll either allow or reject the account connection. After they’ve allowed the connection, they’ll be redirected to the app.
The problem seems to start here. According to multiple sources, including ChatGPT, when the user starts the action that redirects them to the Zoho page sign in, there should be some sort of authorization code in the URL, but I don’t see it. Then, after they’ve allowed the connection and are redirected to the app, Bubble should be capturing an access token and a refresh token. But I’ve checked the logs, URLs, browser developer network settings, and I cannot find any such codes or tokens.
ChatGPT suggests that the solution to the token expiration problem is to use the access token and refresh token to create workflows that capture them and other create other workflows that update the tokens when they’re about to expire. But because I do not receive the tokens, I can’t move forward with this fix.
What am I missing? Any help would be greatly appreciated.