Skip to main content

Hello everyone, I hope you can help me!

 

I am creating an product database for internal purposes. I have created a Softr interface and I want to have a customer chat bot to can answer basic queries such as “Does this product have x feature?” “What is the price of this product” etc… I have managed to create everything with the help of Chat GPT (I can’t code!) but once issue remains, when I try to trigger a database search, it constantly returns with “I can’t find this product”. I have searched the console, it says it cannot access the database because authentication is required and returns an error 401 or 403. 
I have checked the token, the database ID all and everything is correct, so I am a bit at loss! I am the owner of the database. 

Hope someone can assist with this, thanks in advance for any advice!

(Updated post below.)


I don’t know JavaScript, so I’m not sure if this will help you with what you’re trying to do, but in this Airtable podcast episode, I show how to use Make’s ChatBot integrations to integrate ChatBot with Airtable — in a no-code way that doesn’t require any scripting at all.

Regarding the errors you’re getting, you would typically need to make sure that you’re authorizing properly to Airtable. You may want to paste the JavaScript code that you’re using below, so others can help you!

- ScottWorld, Expert Airtable Consultant


Hey ​@QPerry,

This is a really cool project. It’s so inspiring to hear how far you’ve gotten on your own!

I created an app that connected to Airtable with OAuth so I know how difficult it is haha! Can you share with us the code your using to access Airtable and tell us more about the structure of your system? (Make sure not to share any tokens or personal information in your code)


A 401 error means your API request didn’t include a valid authentication token. A 403 error means you’re authenticated, but your token doesn’t have the necessary permissions. So, basically there is some issue with your tokens.

To fix this, make sure you’re using a Personal Access Token (PAT) instead of the old API key. You can create one at airtable.com/create/tokens.

When generating the token, select the correct base and give it the right scopes, atleast data.records:read. Also make sure it has at least read access to your base.

Check that you're passing the token correctly in your request. The Authorization header should look like this: Authorization: Bearer YOUR_PERSONAL_ACCESS_TOKEN

Also double-check your base ID and table name. Even a small typo can result in a 403 error.

One important note is if you're making API requests directly from a browser (for example, from a Softr chatbot), Airtable will block them. This is for security reasons.

To get around that, you'll need to use a backend or no-code tool like tMake](https://www.make.com/en/register?pc=airtableadvisor)  that can safely handle the API call and return the results to your chatbot.

Taha, Airtable Advisor


Hey ​@QPerry,

This is a really cool project. It’s so inspiring to hear how far you’ve gotten on your own!

I created an app that connected to Airtable with OAuth so I know how difficult it is haha! Can you share with us the code your using to access Airtable and tell us more about the structure of your system? (Make sure not to share any tokens or personal information in your code)

Hey, 

Thanks for reaching out and offer to help!

So I have created the code with OpenAI, and I have gone through several different errors such as 402, 403, 404, 422. Now it seems the the code can browse through the Airtable and retrieve the right bits of data so that’s good. I’m trying to make it handle more complex queries which is proving a little bit of a challenge but hopefully I will make some progress on that! 
I need it to handle queries such as “Does product X have X feature” but it is struggling to separate both queries. Any ideas about this please? :)


Unfortunately, I don’t have much experience creating chatbots.

 

But, I’m glad that you figured out how to connect it to Airtable!


Hey ​@QPerry,

Just FYI in case this matters, Airtable has natively developed this AI Assistant feature which basically allows you to chat with your database. Not sure if this solves your issue, or whether you need to provide this to third party users through a different portal/front end and hence your development efforts.

Mike, Consultant @ Automatic Nation
 


Hey ​@QPerry,

Just FYI in case this matters, Airtable has natively developed this AI Assistant feature which basically allows you to chat with your database. Not sure if this solves your issue, or whether you need to provide this to third party users through a different portal/front end and hence your development efforts.

Mike, Consultant @ Automatic Nation
 

Hi Mike, 

Thanks a lot for that, I believe this is only available on a paid plan, so it might be more of a phase 2/3 of the project. At the moment, I am trying to develop this without generating costs, to prove that the concept works. 

Thanks,

Quentin


A 401 error means your API request didn’t include a valid authentication token. A 403 error means you’re authenticated, but your token doesn’t have the necessary permissions. So, basically there is some issue with your tokens.

To fix this, make sure you’re using a Personal Access Token (PAT) instead of the old API key. You can create one at airtable.com/create/tokens.

When generating the token, select the correct base and give it the right scopes, atleast data.records:read. Also make sure it has at least read access to your base.

Check that you're passing the token correctly in your request. The Authorization header should look like this: Authorization: Bearer YOUR_PERSONAL_ACCESS_TOKEN

Also double-check your base ID and table name. Even a small typo can result in a 403 error.

One important note is if you're making API requests directly from a browser (for example, from a Softr chatbot), Airtable will block them. This is for security reasons.

To get around that, you'll need to use a backend or no-code tool like tMake](https://www.make.com/en/register?pc=airtableadvisor)  that can safely handle the API call and return the results to your chatbot.

Taha, Airtable Advisor

Thanks a lot for your help, I did have to generate a few API token and it finally ended up working! I’m still trying to get the bot to handle more complex queries but it’s managed to return data when prompted so that’s a start!

 


UPDATE:

I have successfully connected to Airtable, I am however struggling with the bot handling more complex queries but I don’t think this is a topic for this community so I will be closing this topic, thanks a lot to everyone who took the time to answer. 


Reply