Request JSON file with bubble

Hey bubblers!

Just have a quick issue that should not be a real one for many of you used to using ‘JSON’. I am developing an app on bubble that may requires to store text data in a JSON file which would offer us great flexibility.

I am currently hosting a JSON file on a web hosting server, but unable to connect to it through bubble…

I can access the document when searching it directly in my browser so I don’t believe there is any permissions issue… But I can’t figure out why I am not able to make a call through the API Connector Plugin.

If anyone of you has an idea about this, let me know!

Thanks a lot!
Have a great day,

John

Are you using a “GET” request> can you screenshot the API Connector setup?

Hi William,

Thanks for your reply!
Yes, of course I’ve tried with a GET method as long as I want to read data:

The strange thing is that I’m able to access some files on another webserver, but not this one (getting the 403 error message)

can you share the first part of the API connector? Did you set any security stuff? Also, use https instead.

Hi Jici,

Thanks for your time!
Sure, I didn’t use any security stuff, as I am able to access it directly, and double checked in filezilla that the file and whole folder was publicly accessible.

https is not working on this web cloud I think…

I’ve tested the same URL (and with https) and it’s work for me. Maybe you can try to delete this API and create a clean new one.

1 Like

If you try out with this one, does it still work ?
https://doc.***.com/sample1.json

No but it will work if you add a user-agent header

Thanks Jici for your reply!

What do you mean by user-agent header, and which value should it takes?

I can’t get why on this one I would need one, whereas on the other one there is no need for one…?

Thanks a lot,

This depend of the server settings. In this case, this seem to be requested. You can enter anything you want, but I always recommend to use bubble/yourappname.

When you put the url in a browser, browser always include a user-agent header. Same for tool like insomnia and postman. Bubble doesn’t do it.

Thanks a lot for this explanation!

But I still get the same issue, eventhough I have added a header… Am I doing something wrong?

Are you able to access this on a bubble app test? (like the https://stopbaise.fr/sample1.json

Thanks a lot

the key should be user-agent
value bubble/test

Not sure to get the current issue then:

KEY = user-agent
VALUE= bubble/test

1 Like

I am definitely dumb, sorry!!

Thanks a lot, it works perfectly! Wonderful :heart_eyes:

1 Like

Jici,

Me again (everything working fine), but I would like to know if I can filter directly in the request (and so minimize bubble WU)? Do you have any clue on this?

I tried adding ‘id’ to the sample file, and a parameter called ‘id’ in the API call, but it seems not to work…

No I don’t think. if this is just a file and the server doesn’t process your request, it’s not possible. Check the API doc to know if you can filter using ID

1 Like

That’s what I thought too.

Thanks a lot, will have a look → if I find a solution that suits well, I will share it here