How To URL Encode Search Constraints Quickly?

Is there a tool to encode search constraints into the Bubble specific format easily and quickly???

"Constraints with an undefined value are ignored. Do not use ‘_id’ as a key for a constraint. Instead, use the call that retrieves a thing by ID. See above.

For example, if you’re looking for all ‘coffeeshops’ located within 10 miles of New York, whose ‘name’ contains ‘cafe,’ you will send a constraint parameter as follows:

constraints = [ { “key”: “name”, “constraint_type”: “text contains”, “value”: “cafe” } , { “key”: “address”, “constraint_type”: “geographic_search”, “value”: { “range”:10, “origin_address”:“New York” } } ]

or URL-encoded:

constraints=%5B%7B%22key%22%3A%22name%22%2C%22constraint_type%22%3A%22text%20contains%22%2C%20%22value%22%3A%22cafe%22%7D%2C%7B%22key%22%3A%22address%22%2C%22constraint_type%22%3A%22geographic_search%22%2C%22value%22%3A%7B%22range%22%3A10%2C%22origin_address%22%3A%22New%20York%22%7D%7D%5D
The full URL would look like:

https://coffeesearcher.bubbleapps.io/api/1.1/obj/coffeeshops?api_token=YOUR_API_TOKEN&constraints=[{“key”%3A"name"%2C"constraint_type"%3A"text%20contains"%2C%20"value"%3A"cafe"}%2C{“key”%3A"address"%2C"constraint_type"%3A"geographic_search"%2C"value"%3A{“range”%3A10%2C"origin_address"%3A"New%20York"}}]&sort_field=name"

1 Like

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