#[SOLVED] Query params not working as expected

1 messages · Page 1 of 1 (latest)

upper plinth
#

Hey hey! I have a function and I want to add a query parameter to it, but that gives me the following error, as if the query parameters are a route!
The requested route was not found. Please refer to the API docs and try again.

I'm using appwrite's auto generated URL and just adding a ?teams=3052 at the end of it

This is source code for the function I am using:
https://github.com/unickorn/footcal/blob/main/functions/calendar/main.go

GitHub

football calendar. Contribute to unickorn/footcal development by creating an account on GitHub.

scarlet cloud
#

Was this working prior to adding that teams query param?

upper plinth
#

I didn’t really try it that way since the whole point of the query was to get matches for teams. The url without the query params does return an empty page

scarlet cloud
#

Could you send the full URL you're using, you can obfuscate the id or whatever

#

How are you calling it?

upper plinth
#

Tried through browser and curl:

scarlet cloud
#

Are the slashes just to escape?

#

Does it not let you do it without them?

upper plinth
#

Ah yeah I did it in single quotes instead of escaping now, got The requested route was not found. Please refer to the API docs and try again.% as response with curl as well now

analog flame
#

if the url doesn't work, your url is just incorrect

upper plinth
#

??? what does that mean now, that’s literally the url on the panel

upper plinth
#

very interesting

upper plinth
#

well, this is keeping me from finishing my hackathon project… i really don’t get what i could be doing wrong, has anyone tried using go functions with query params?

oblique oak
#

You can check the url to make request in the docs:

https://appwrite.io/docs/references/cloud/client-web/teams

your URL should have this format

https://proyectid.appwrite.global/v1/teams

The Teams service allows you to group users of your project and to enable them to share read and write access to your project resources, such as database documents or storage files.

Each user who creates a team becomes the team owner and can delegate the ownership role by inviting a new team member. Only t...

tranquil burrow
upper plinth
tranquil burrow
oblique oak
scarlet cloud
tranquil burrow
upper plinth
upper plinth
upper plinth
#

Okay it turns out the error was from another call to appwrite databases, where I put the database ID env variable name wrong

#

So it was just calling // where the url would be /{database_id}/ and resulting in that cryptic error

oblique oak
#

It was _APP_DOMAIN_FUNCTIONS?

scarlet cloud