Hello, I'm attempting to execute a cloud function via an HTTP request. I've read the documentation, which mentions that each function has its own domain. I've also included the project ID and content-type in the headers, and I received a dummy response as the following
{"motto":"Build like a team of hundreds_","learn":"https://appwrite.io/docs","connect":"https://appwrite.io/discord","getInspired":"https://builtwith.appwrite.io"}
The documentation that i read was https://appwrite.io/docs/products/functions/execution
So how can I make http request for my Appwrite cloud function using REST API?
Thanks in advance
Yes, if you look at the overview page of your function, in the card with the details of the active deployment, there should be a link. That link is your function.
Executing the function via the rest API is something different. Did you want to use the domain or REST API?
@Steven I want to execute the function using REST API and get the response of the function.
for example like this http request https://dummy.restapiexample.com/api/v1/employees
You could use either the Appwrite REST API or the function domain
Anyways, I'm still not sure what your problem is. Can you clarify?
@Steven, Actually the issue has been resolved. After you confirmed that it can be done, I compared the code that came with the initial template to my code and found the problem: I forgot to include the return keyword. Instead of writing:
return context.res.send(response.body.toString());
I should have written:
context.res.send(response.body.toString());
Thank you very much, @Steven, for your help.
[SOLVED] REST API with Cloud Functions
Recommended threads
- Enabling Overage Usage
Hello Appwrite Support Team, I am currently using Appwrite under the GitHub Student Developer Pack plan. Recently, my project hit the database read limit, and ...
- appwrite-docs MCP fails in Cursor — SSE ...
Hi team, I'm having trouble getting the hosted Appwrite docs MCP working in Cursor on Windows. Environment IDE: Cursor (latest) OS: Windows 11 Node: v24.15.0 ...
- Migration from Cloud to Self-Hosted not ...
Hello Appwrite Community, I've got the problem, that when I try to migrate my Appwrite Project from the cloud to my self-hosted Appwrite, that an API Key is mi...