Back

[SOLVED] How to include queries in the basic get request?

  • 0
  • Databases
Argel
16 May, 2023, 09:13

Please, what is to correct way that the URL should look like?

I looked at the documentation, but it's unclear to me. And I cannot figure this out for hours already.

https://appwrite.io/docs/rest#client-auth

TL;DR
The user had a problem including queries in a basic GET request. They tried using Insomnia but it didn't work, so they switched to Postman. They shared an example of the query they used but still couldn't get it to work. Other users suggested trying to pass the query in the URL and as an object in the request body, but the user was still unsure about the correct format. No solution was provided in the thread.
safwan
16 May, 2023, 09:18

You have to pass the queries as an object in the request body

Argel
16 May, 2023, 09:34

Sorry still I cannot figure this out. Please 🙏 how should I correctly fill this?

Argel
16 May, 2023, 09:34

This results in this:

TypeScript
> GET /v1/databases/63a97cf0a759183bd1c6/collections/63a97d42d1d2518dea90/documentsHTTP/1.1 HTTP/1.1
> Host: appwrite.app.timenoder.com
> User-Agent: insomnia/2023.1.0
> Content-Type: multipart/form-data; boundary=X-INSOMNIA-BOUNDARY
> X-Appwrite-Project: 64631bad5cbf9ab42392
> Accept: */*
> Content-Length: 126

| --X-INSOMNIA-BOUNDARY
| Content-Disposition: form-data; name="queries[]"
| equal("name", ["Test2"])
| --X-INSOMNIA-BOUNDARY--
Binyamin
16 May, 2023, 10:04

Can you try to pass it in the URL?

Binyamin
16 May, 2023, 10:04

As such

Binyamin
16 May, 2023, 10:07

documents?queries[]=Query.equal("name", ["Test2"])

Binyamin
16 May, 2023, 10:07

Let me know if that works

Argel
16 May, 2023, 10:20

Finally 🙏

The problem was in Insomnia (through which I am making the API calls), it does something unxespected. The solution was in using Postman.

Thank you for responding!. But close enough :).

....v1?queries[]=equal("name", [Test1])

Argel
16 May, 2023, 10:23

[SOLVED] How to include queries in the basic get request?

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