Home App Docs Blog Github

401 unauthorized Error when attempting to fetch "Data" Model types


I am a new user with Builder IO, I attempted to create my first “Data” model type in the visual editor and followed the developers usage. Unfortunately the response is always “401 Unauthorized”.

Steps to reproduce:

Authenticate to builder IO
Navigate to builder .io/models and click “create model”. Select “data”, name it and add one field of type “list” and on child field of type “text”.

Click on “show more options” and toggle “public readable” to off and save.

Finally click on “try in the Rest api explorer”, “try it” and “execute”.

Expected Result:

I was expecting a 200 status code with result being an empty array: “result:” [].

Current Result:


More information:

I went back to builder .io/models, selected my new data model, clicked on “show more options” and toggled “public readable” to true and saved.

Then went back to the API explorer, did the same steps but still got 401. I checked the API key and it’s correct.

I went back to builder .io/models, clicked on my data model again, went to “Developer usage”, “Rest API” and copied the “cURL” command. I also have a 401. I clicked on “Javascript”, copied the code and also 401.

I created a new entry by navigating to builder .io/content, “New”, selected the data model type I created. In the editor I filled my custom field and clicked “Publish”. It didn’t solve the 401 issue.

When I try with a “section” model type. I am able to get a 200 status code and see the content.

I’m not sure what I did wrong and why I’m receiving a 401 error.

If more information is needed, I’m happy to provide it.
Thank you for your help.

ps: I had to break some of the urls (eg: builder .io) because “Sorry, new users can only put 2 links in a post.”.

Hey @Armand thank you so much for the details and reproduction steps. We’re taking a look on our end and will follow-up!

Hello Kara,

I’m not sure if you did something already but today I am able to get the data with a 200 status code.

@Armand , great, glad to hear it’s working for you. Don’t hesitate to reach out if you have any additional questions!