Would love to get advice on what I may be doing wrong here. I’m attempting to retrieve a list of things using the Data API. I’m successfully able to retrieve the list without any constraints, but as soon as I add the constraint, I receive a 400 error.
I know that the data I’m filtering for exists, and don’t believe there is any error in my constraints. Therefore, I’m guessing it’s an issue with how I am encoding it, but all of my attempts have failed so far. I’ve tried the following:
- Different parameters, many of which shouldn’t filter anything out
- Different capitalization of the key
- Using the verbatim URL encode snippet from the bubble manual (swapped in my key name and constraint)
Any idea what I may be doing wrong?
My code for the constraints is here:
constraints = [
{
"key": "Hours",
"constraint_type": "is_not_empty",
}
]
params = {'cursor': cursor, 'api_token': API_KEY, 'constraints': constraints}
url = base_url + urllib.parse.urlencode(params)
Printed URL
https://websitename.bubbleapps.io/version-test/api/1.1/obj/employeetiming?cursor=0&api_token=token&constraints=%5B%7B%27key%27%3A+%27hours%27%2C+%27constraint_type%27%3A+%27is_not_empty%27%7D%5D