I'm hoping to use appwrite function as handler for inbound webhook from xero. Can't add custom authentication to xero webhook (i.e. can't configure to include x-appwrite-project).
So, I can create function execution via rest api fine with x-appwrite-project header, but if I try to use the project query param I'm getting Function with the requested ID could not be found.
Is it possible to execute a function without appwrite headers?
Maybe this will help: https://appwrite.io/docs/rest#no-headers
yep, I was going off that example. so trying something like this is what's returning the error above
https://[MY_APPWRITE_URL]/v1/functions/[FUNCTION_ID]/executions?project=[MY_PROJECT_ID]
You sure the project is correct? And request method is post? And permissions are set to any
?
yep. project id in url is the same as project id in header (in postman) if I toggle the x-appwrite-project header on, I can create function execution, if I toggle off (with project id as query param) then it fails with Function with the requested ID could not be found.
How about if you include it in the request body?
yep, that works
but same issue as with headers re xero webhook...
Honestly, functions don't work so well as a web hook right now. It will in a future release 😁
For now, you might need a proxy in front of Appwrite
ahh, cool. thanks @Steven
yep, I was hoping to avoid that, but need it for another reason anyway - i.e. parsing and transforming the resposne structure from function execution to conform with openapi spec...
Hey @arpentnoir - shall I close this post if your doubt is resolved?
yes, thanks
[SOLVED] execute a function via rest api without headers?
Recommended threads
- How to Avoid Double Requests in function...
I'm currently using Appwrite's `functions.createExecution` in my project. I want to avoid double requests when multiple actions (like searching or pagination) a...
- Project in AppWrite Cloud doesn't allow ...
I have a collection where the data can't be opened. When I check the functions, there are three instances of a function still running that can't be deleted. The...
- Get team fail in appwrite function
I try to get team of a user inside appwrite function, but i get this error: `AppwriteException: User (role: guests) missing scope (teams.read)` If i try on cl...