T
Twenty5mo ago
Alex

Error: 'filter' invalid for ''

Hi all! I am trying to filter my noteTargets by noteId and I keep getting the following error:
400
Failed to fetch notes: 400 - {"statusCode":400,"error":"BadRequestException","messages":["'filter' invalid for ''. eg: price[gte]:10"]}
400
Failed to fetch notes: 400 - {"statusCode":400,"error":"BadRequestException","messages":["'filter' invalid for ''. eg: price[gte]:10"]}
I'm running the following piece of code:
response = requests.get(
f"https://twenty.insikt.aux.recfut.com/rest/noteTargets?filter=noteId[like]:{note_id}",
headers={"Authorization": f"Bearer {TWENTY_TOKEN}"}
)
response = requests.get(
f"https://twenty.insikt.aux.recfut.com/rest/noteTargets?filter=noteId[like]:{note_id}",
headers={"Authorization": f"Bearer {TWENTY_TOKEN}"}
)
I've checked my data, and note_id (the actual value) definitely exists in both my notes and in noteTargets. I'm self-hosting the latest version of Twenty, and this issue occurs whether I use the API tester, or use cURL or Python. Any help as to why this error is popping up (and how to fix it) would be greatly appreciated!
3 Replies
ɃØĦɆᵾS
ɃØĦɆᵾS5mo ago
@Alex I've checked and I'm able to reproduce this error, I've tried to find a workaround but it seems like this specific filter doesn't want to cooperate However, from what I've seen, /note endpoint returns an id of noteTarget when depth=1 so I'd suggest using id[eq]:"{noteTarget_id}" in /noteTargets endpoint as a filter, I've checked and it works
ɃØĦɆᵾS
ɃØĦɆᵾS5mo ago
GitHub
REST API - noteTargets can't be filtered by linked note · Issue #1...
Ticket from Discord https://discord.com/channels/1130383047699738754/1394900601288261723 Scenario: Log in Go to Settings > enable Advanced > API Generate new API key or use existing one Open ...
Alex
AlexOP5mo ago
Thanks @bob, this was a great tip! I ended up using depth=2 since that contained the actual data I needed.

Did you find this page helpful?