I’m building a client portal on Bubble that connects to Salesforce. The goal is to let contacts (who currently don’t have Salesforce access) log in, view their data (cases, profiles, etc.), and make updates that sync back to Salesforce in real-time.
Here’s the situation:
I have a CSV file of contacts (First Name, Last Name, Email, Username) from Salesforce, but no Salesforce IDs.
I’ve set up the API Connector using Salesforce’s OAuth2 User-Agent Flow but keep getting a 401: Session expired or invalid error when testing.
I need to dynamically pull data from Salesforce using the logged-in user’s email and allow changes made in Bubble (like profile updates or new cases) to sync back.
Contacts don’t have passwords yet, so I plan to onboard them via Bubble’s Forgot Password feature.
I need well detailed help with:
Fixing the 401 error during API setup.
Dynamically using the logged-in user’s email for API calls.
Setting up two-way data sync between Bubble and Salesforce.
Ensuring my onboarding plan is practical.
Any advice or alternative solutions would be greatly appreciated. Thanks so much for your help!
NB: I’m still a beginner with bubble, which is why I’m having issues with API setup. @Jici - I’ve seen your comments on topics similar to mine, I’d like if you can kindly help me out with this - I’m already nearing the end of the submission and I haven’t been able to make significant headway regarding this issue. Thanks in advance.
I know you get the error in Bubble, but did you get it in run mode or api connector?
According to the screenshot, you didn’t initialize the auth part (in debug_mode with action login to social network). This is needed to be able to add calls.
However, in your case, it may be better to handle this manually because you will use Bubble login.
I got the error when I tried initializing the API call I made. I’m getting kinda confused with your response.
Is there anyway to get you privately, probably an email address. I feel like I need to explain in details what I’m trying to achieve for you to be able to better understand and walk me through. Thanks in advance.
I don’t offer private support actually.
When you set user-agent auth in Bubble API Connector, you first need to “iniialize” the auth. This is what the message at the bottom tell you: Create a page with a button with action set to login with a social network and click on preview. Authenticate to your SF account to initialize API Connector auth. Once it’s done, add new API Calls that will use this auth. Take note that API Connector with not keep your connection alive and once the access token is expired, you need to reauthenticate again. However, Bubble will keep access_token alive when needed using the refresh token for your users.
However, like I said, I think you should consider to use the manual auth process instead and set API Connector to none/self-handled auth.