Back

[SOLVED] Search Queries With REST API

  • 0
  • Web
Dennis Ivy
6 Jun, 2023, 07:05

I'm trying to make a request with a search query while using the REST API and can only find documentation for how to do this with the SDK.

For example: URL/posts/documents?query=user_id=${UID}

Is this possible?

TL;DR
The user is asking if it is possible to use search queries with the REST API. They mention that they can only find documentation for how to do this with the SDK. A solution is provided by suggesting to check the documentation for a later version of Appwrite that might have REST docs.
safwan
6 Jun, 2023, 07:05

Are you using cloud?

Dennis Ivy
6 Jun, 2023, 07:06

Yes

safwan
6 Jun, 2023, 07:06

Cloud doesn't support a REST API right now, as far as I know πŸ˜…

Dennis Ivy
6 Jun, 2023, 07:07

I've already read these docs but they are refering to the SDK: https://appwrite.io/docs/queries

Dennis Ivy
6 Jun, 2023, 07:07

Interesting. I am able to make request with cloud and it works fine. Just not sure what the query params should look like

Dennis Ivy
6 Jun, 2023, 07:07

How would this look normally, without cloud?

safwan
6 Jun, 2023, 07:08

That's interesting πŸ‘€ I assumed it wasn't supported as there were no docs.

You can try checking the docs for a later version of Appwrite that have REST docs.

safwan
6 Jun, 2023, 07:08

Might give you an idea of how the request would need to be.

Dennis Ivy
6 Jun, 2023, 07:09

I'll try to find those. As long as it's possible.

Dennis Ivy
6 Jun, 2023, 07:09

Dont want to be looking for something that's not there πŸ˜‰

safwan
6 Jun, 2023, 07:09

Seems like REST docs were added from v1.2.x: https://appwrite.io/docs/client/account?sdk=web-default&v=1.2.x

Dennis Ivy
6 Jun, 2023, 07:43

I'm definitely getting closer with this resource but still having a hard time constructing the query: https://appwrite.io/docs/rest#query

Bouahaza
6 Jun, 2023, 09:14

?queries[]=select()&queries[]=equal()&queries[]=limit()

Bouahaza
6 Jun, 2023, 09:15

I suggest you to create a generator, wich loop over your arguments

Guille
6 Jun, 2023, 14:45

You can what the SDK do when a query is sent: https://github.com/appwrite/sdk-for-web/blob/master/src/query.ts

Drake
6 Jun, 2023, 15:19

it should still be possible. we just improved our docs starting with 1.2

Drake
6 Jun, 2023, 15:20

feel free to share what you have so we can see if we can help

D5
15 Sep, 2023, 20:50

This is solved, right?

D5
15 Sep, 2023, 20:50

Not sure why it appears in the top

Dennis Ivy
19 Sep, 2023, 00:12

Yep

Guille
19 Sep, 2023, 03:24

[SOLVED] Search Queries With REST API

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