mirror of
https://github.com/appwrite/appwrite
synced 2026-05-15 21:19:19 +00:00
757 B
757 B
import io.appwrite.Client; import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Databases;
Client client = new Client(context) .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setSession("") // The user session to authenticate with .setKey("") // .setJWT("<YOUR_JWT>"); // Your secret JSON Web Token
Databases databases = new Databases(client);
databases.upsertDocument( "<DATABASE_ID>", // databaseId "<COLLECTION_ID>", // collectionId "<DOCUMENT_ID>", // documentId new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); return; }
Log.d("Appwrite", result.toString());
})
);