2026-02-03 10:18:48 +00:00
|
|
|
```java
|
2025-06-19 12:43:27 +00:00
|
|
|
import io.appwrite.Client;
|
|
|
|
|
import io.appwrite.coroutines.CoroutineCallback;
|
|
|
|
|
import io.appwrite.services.Functions;
|
2025-11-18 05:37:50 +00:00
|
|
|
import io.appwrite.enums.ExecutionMethod;
|
2025-06-19 12:43:27 +00:00
|
|
|
|
|
|
|
|
Client client = new Client(context)
|
|
|
|
|
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
|
|
|
|
.setProject("<YOUR_PROJECT_ID>"); // Your project ID
|
|
|
|
|
|
|
|
|
|
Functions functions = new Functions(client);
|
|
|
|
|
|
|
|
|
|
functions.createExecution(
|
|
|
|
|
"<FUNCTION_ID>", // functionId
|
|
|
|
|
"<BODY>", // body (optional)
|
|
|
|
|
false, // async (optional)
|
|
|
|
|
"<PATH>", // path (optional)
|
|
|
|
|
ExecutionMethod.GET, // method (optional)
|
2025-11-23 06:39:28 +00:00
|
|
|
Map.of("a", "b"), // headers (optional)
|
2025-07-30 05:09:28 +00:00
|
|
|
"<SCHEDULED_AT>", // scheduledAt (optional)
|
2025-06-19 12:43:27 +00:00
|
|
|
new CoroutineCallback<>((result, error) -> {
|
|
|
|
|
if (error != null) {
|
|
|
|
|
error.printStackTrace();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Log.d("Appwrite", result.toString());
|
|
|
|
|
})
|
|
|
|
|
);
|
|
|
|
|
|
2026-02-03 10:18:48 +00:00
|
|
|
```
|