Get Data from API to Database with constraints

Hello everyone,

I need your help on a problem that’s starting to get on my nerves…

I have a Bubble Backend. To figure out how to get a list of things and search with constraints, I use POSTMAN. Firstly, I wanted to display all items from a field(Building) :
GET : https://myapp/version-test/api/1.1/obj/Building
image
So that’s awesome.

Now, imagine I have more than 100 items so I wont be able to display all my items, so I decided to add constraints and tested them :
GET : https://myapp/version-test/api/1.1/obj/Building?constraints=[{“key”:“CP_Building”,“constraint_type”:“equals”,“value”:“44300”}]

I dont understand why I get this answer…

Anyone to help me ?

Thanks in advance

let constraints = encodeURIComponent(
    JSON.stringify([{"key": "CP_Building", "constraint_type": "equals", "value": "443300"}])
)
const url = myURLendpoint + `&constraints=${constraints}`

This is what I had to do to get it to work. JSON.stringify it and then encode it.

This topic was automatically closed after 70 days. New replies are no longer allowed.