Back

HTTP request for Database Queries

  • 0
  • Databases
  • REST API
  • Web
  • Cloud
Martin
27 Apr, 2024, 11:44

Hi dear, Something has changed? Previously queries[] was ok now it reports an error, but now query[] works. I am confused.

Example: https://appwrite.exampledomain.com/v1/databases/<database ID> /collections/<collection ID/documents?queries[0]=limit(5)

API call response: Error: JSON error response from server: {"message":"Invalid query: Syntax error","code":400,"type":"general_query_invalid","version":"0.13.4"}.status: 400

https://appwrite.exampledomain.com/v1/databases/<database ID> /collections/<collection ID/documents?query[0]=limit(5)

API call response: OK.

TL;DR
Developers noticed a change in API calls for database queries. Previously using 'queries[]' was fine but now 'query[]' is working. When using 'query[]' it produces an error, while 'queries[]' was fine before. Solution: Use 'queries[]' instead of 'query[]' for the API call to avoid errors and get a successful response.
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more