The use case is simple. As much as I read, your deployed appwrite functions are only triggered by some appwrite event for example: making users, adding files, so and so forth. What I want is to get an api endpoint something like: https://appwrite.cloud/v1/function, which I can call from the client.
I'm not sure if there is an endpoint, but if you want to execute it on demand from your client-side app, you can use the createExecution endpoint in the Functions API
ohh thanks
The docs linked here are for v1.1, so feel free to change if you're on a different version 😄
yaa
so basically I can call this create execution api and the appwrite server would start running the function?
this is what I understood from the docs
Yes that's absolutely right!
export async function executeTeamsFunction(id: string, mode: string, email: string) {
try {
if (id === '') {
return;
} else {
const promise = await functions.createExecution(
id,
`{
"mode": "${mode}",
"email": "${email}"
}`
);
return promise;
}
} catch (error) {
if (error instanceof AppwriteException) {
console.log(error.message);
} else {
console.log(error);
}
}
}```
Here's an example
are you participating in the hackathon?
what are you building
I'm building a patient-doctor dashboard Please keep messages in <#1072905050399191082> threads related to issues. I'd be more than happy talking about my project in the <#1106531116317417564> 😄 <:appwritepeepo:902865250427215882>
ohh sorry.
atb
No worries <:appwritemagician:946072299172409414>
[SOLVED] Is there a way to get an endpoint for your deployed functions.
Recommended threads
- Creating a function on appwrite Cloud.
I am trying to create a function on Appwrite cloud. I go to the console. I hit : Create function I choose DART-3.5 I put a name for my function : NameFunction...
- SSR Auth with Tanstack Start requires ha...
I followed the Next.js guide for SSR Auth on https://appwrite.io/docs/tutorials/nextjs-ssr-auth/step-1 I tried to replicate it for Tanstack Start. However, on...
- Function connected custom domain error: ...
My domain is served through Cloudflare. Domain is now connected with the appwrite function. But when accessing the domain, I get the below error. Any suggestion...