update: generate docs examples as per latest 1.8.x source.

This commit is contained in:
Darshan
2025-06-19 18:13:27 +05:30
parent c7a3ffdb71
commit 974037ee38
6235 changed files with 96496 additions and 0 deletions
@@ -0,0 +1,12 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Account;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>'); // Your project ID
$account = new Account($client);
$result = $account->createAnonymousSession();
@@ -0,0 +1,15 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Account;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>'); // Your project ID
$account = new Account($client);
$result = $account->createEmailPasswordSession(
email: 'email@example.com',
password: 'password'
);
@@ -0,0 +1,16 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Account;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>'); // Your project ID
$account = new Account($client);
$result = $account->createEmailToken(
userId: '<USER_ID>',
email: 'email@example.com',
phrase: false // optional
);
@@ -0,0 +1,12 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Account;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>'); // Your project ID
$account = new Account($client);
$result = $account->createJWT();
@@ -0,0 +1,17 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Account;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>'); // Your project ID
$account = new Account($client);
$result = $account->createMagicURLToken(
userId: '<USER_ID>',
email: 'email@example.com',
url: 'https://example.com', // optional
phrase: false // optional
);
@@ -0,0 +1,16 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Account;
use Appwrite\Enums\AuthenticatorType;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setSession(''); // The user session to authenticate with
$account = new Account($client);
$result = $account->createMfaAuthenticator(
type: AuthenticatorType::TOTP()
);
@@ -0,0 +1,15 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Account;
use Appwrite\Enums\AuthenticationFactor;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>'); // Your project ID
$account = new Account($client);
$result = $account->createMfaChallenge(
factor: AuthenticationFactor::EMAIL()
);
@@ -0,0 +1,13 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Account;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setSession(''); // The user session to authenticate with
$account = new Account($client);
$result = $account->createMfaRecoveryCodes();
@@ -0,0 +1,18 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Account;
use Appwrite\Enums\OAuthProvider;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>'); // Your project ID
$account = new Account($client);
$result = $account->createOAuth2Token(
provider: OAuthProvider::AMAZON(),
success: 'https://example.com', // optional
failure: 'https://example.com', // optional
scopes: [] // optional
);
@@ -0,0 +1,15 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Account;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>'); // Your project ID
$account = new Account($client);
$result = $account->createPhoneToken(
userId: '<USER_ID>',
phone: '+12065550100'
);
@@ -0,0 +1,13 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Account;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setSession(''); // The user session to authenticate with
$account = new Account($client);
$result = $account->createPhoneVerification();
@@ -0,0 +1,16 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Account;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setSession(''); // The user session to authenticate with
$account = new Account($client);
$result = $account->createRecovery(
email: 'email@example.com',
url: 'https://example.com'
);
@@ -0,0 +1,15 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Account;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>'); // Your project ID
$account = new Account($client);
$result = $account->createSession(
userId: '<USER_ID>',
secret: '<SECRET>'
);
@@ -0,0 +1,15 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Account;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setSession(''); // The user session to authenticate with
$account = new Account($client);
$result = $account->createVerification(
url: 'https://example.com'
);
@@ -0,0 +1,17 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Account;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>'); // Your project ID
$account = new Account($client);
$result = $account->create(
userId: '<USER_ID>',
email: 'email@example.com',
password: '',
name: '<NAME>' // optional
);
@@ -0,0 +1,15 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Account;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setSession(''); // The user session to authenticate with
$account = new Account($client);
$result = $account->deleteIdentity(
identityId: '<IDENTITY_ID>'
);
@@ -0,0 +1,16 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Account;
use Appwrite\Enums\AuthenticatorType;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setSession(''); // The user session to authenticate with
$account = new Account($client);
$result = $account->deleteMfaAuthenticator(
type: AuthenticatorType::TOTP()
);
@@ -0,0 +1,15 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Account;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setSession(''); // The user session to authenticate with
$account = new Account($client);
$result = $account->deleteSession(
sessionId: '<SESSION_ID>'
);
@@ -0,0 +1,13 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Account;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setSession(''); // The user session to authenticate with
$account = new Account($client);
$result = $account->deleteSessions();
@@ -0,0 +1,13 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Account;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setSession(''); // The user session to authenticate with
$account = new Account($client);
$result = $account->getMfaRecoveryCodes();
@@ -0,0 +1,13 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Account;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setSession(''); // The user session to authenticate with
$account = new Account($client);
$result = $account->getPrefs();
@@ -0,0 +1,15 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Account;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setSession(''); // The user session to authenticate with
$account = new Account($client);
$result = $account->getSession(
sessionId: '<SESSION_ID>'
);
@@ -0,0 +1,13 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Account;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setSession(''); // The user session to authenticate with
$account = new Account($client);
$result = $account->get();
@@ -0,0 +1,15 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Account;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setSession(''); // The user session to authenticate with
$account = new Account($client);
$result = $account->listIdentities(
queries: [] // optional
);
@@ -0,0 +1,15 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Account;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setSession(''); // The user session to authenticate with
$account = new Account($client);
$result = $account->listLogs(
queries: [] // optional
);
@@ -0,0 +1,13 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Account;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setSession(''); // The user session to authenticate with
$account = new Account($client);
$result = $account->listMfaFactors();
@@ -0,0 +1,13 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Account;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setSession(''); // The user session to authenticate with
$account = new Account($client);
$result = $account->listSessions();
@@ -0,0 +1,16 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Account;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setSession(''); // The user session to authenticate with
$account = new Account($client);
$result = $account->updateEmail(
email: 'email@example.com',
password: 'password'
);
@@ -0,0 +1,15 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Account;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setSession(''); // The user session to authenticate with
$account = new Account($client);
$result = $account->updateMFA(
mfa: false
);
@@ -0,0 +1,15 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Account;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>'); // Your project ID
$account = new Account($client);
$result = $account->updateMagicURLSession(
userId: '<USER_ID>',
secret: '<SECRET>'
);
@@ -0,0 +1,17 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Account;
use Appwrite\Enums\AuthenticatorType;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setSession(''); // The user session to authenticate with
$account = new Account($client);
$result = $account->updateMfaAuthenticator(
type: AuthenticatorType::TOTP(),
otp: '<OTP>'
);
@@ -0,0 +1,16 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Account;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setSession(''); // The user session to authenticate with
$account = new Account($client);
$result = $account->updateMfaChallenge(
challengeId: '<CHALLENGE_ID>',
otp: '<OTP>'
);
@@ -0,0 +1,13 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Account;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setSession(''); // The user session to authenticate with
$account = new Account($client);
$result = $account->updateMfaRecoveryCodes();
@@ -0,0 +1,15 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Account;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setSession(''); // The user session to authenticate with
$account = new Account($client);
$result = $account->updateName(
name: '<NAME>'
);
@@ -0,0 +1,16 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Account;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setSession(''); // The user session to authenticate with
$account = new Account($client);
$result = $account->updatePassword(
password: '',
oldPassword: 'password' // optional
);
@@ -0,0 +1,15 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Account;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>'); // Your project ID
$account = new Account($client);
$result = $account->updatePhoneSession(
userId: '<USER_ID>',
secret: '<SECRET>'
);
@@ -0,0 +1,16 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Account;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setSession(''); // The user session to authenticate with
$account = new Account($client);
$result = $account->updatePhoneVerification(
userId: '<USER_ID>',
secret: '<SECRET>'
);
@@ -0,0 +1,16 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Account;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setSession(''); // The user session to authenticate with
$account = new Account($client);
$result = $account->updatePhone(
phone: '+12065550100',
password: 'password'
);
@@ -0,0 +1,15 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Account;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setSession(''); // The user session to authenticate with
$account = new Account($client);
$result = $account->updatePrefs(
prefs: []
);
@@ -0,0 +1,17 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Account;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setSession(''); // The user session to authenticate with
$account = new Account($client);
$result = $account->updateRecovery(
userId: '<USER_ID>',
secret: '<SECRET>',
password: ''
);
@@ -0,0 +1,15 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Account;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setSession(''); // The user session to authenticate with
$account = new Account($client);
$result = $account->updateSession(
sessionId: '<SESSION_ID>'
);
@@ -0,0 +1,13 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Account;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setSession(''); // The user session to authenticate with
$account = new Account($client);
$result = $account->updateStatus();
@@ -0,0 +1,16 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Account;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setSession(''); // The user session to authenticate with
$account = new Account($client);
$result = $account->updateVerification(
userId: '<USER_ID>',
secret: '<SECRET>'
);
@@ -0,0 +1,19 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Avatars;
use Appwrite\Enums\Browser;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setSession(''); // The user session to authenticate with
$avatars = new Avatars($client);
$result = $avatars->getBrowser(
code: Browser::AVANTBROWSER(),
width: 0, // optional
height: 0, // optional
quality: -1 // optional
);
@@ -0,0 +1,19 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Avatars;
use Appwrite\Enums\CreditCard;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setSession(''); // The user session to authenticate with
$avatars = new Avatars($client);
$result = $avatars->getCreditCard(
code: CreditCard::AMERICANEXPRESS(),
width: 0, // optional
height: 0, // optional
quality: -1 // optional
);
@@ -0,0 +1,15 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Avatars;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setSession(''); // The user session to authenticate with
$avatars = new Avatars($client);
$result = $avatars->getFavicon(
url: 'https://example.com'
);
@@ -0,0 +1,19 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Avatars;
use Appwrite\Enums\Flag;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setSession(''); // The user session to authenticate with
$avatars = new Avatars($client);
$result = $avatars->getFlag(
code: Flag::AFGHANISTAN(),
width: 0, // optional
height: 0, // optional
quality: -1 // optional
);
@@ -0,0 +1,17 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Avatars;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setSession(''); // The user session to authenticate with
$avatars = new Avatars($client);
$result = $avatars->getImage(
url: 'https://example.com',
width: 0, // optional
height: 0 // optional
);
@@ -0,0 +1,18 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Avatars;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setSession(''); // The user session to authenticate with
$avatars = new Avatars($client);
$result = $avatars->getInitials(
name: '<NAME>', // optional
width: 0, // optional
height: 0, // optional
background: '' // optional
);
@@ -0,0 +1,18 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Avatars;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setSession(''); // The user session to authenticate with
$avatars = new Avatars($client);
$result = $avatars->getQR(
text: '<TEXT>',
size: 1, // optional
margin: 0, // optional
download: false // optional
);
@@ -0,0 +1,20 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Databases;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setKey('<YOUR_API_KEY>'); // Your secret API key
$databases = new Databases($client);
$result = $databases->createBooleanAttribute(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '',
required: false,
default: false, // optional
array: false // optional
);
@@ -0,0 +1,20 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Databases;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setKey('<YOUR_API_KEY>'); // Your secret API key
$databases = new Databases($client);
$result = $databases->createCollection(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
name: '<NAME>',
permissions: ["read("any")"], // optional
documentSecurity: false, // optional
enabled: false // optional
);
@@ -0,0 +1,20 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Databases;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setKey('<YOUR_API_KEY>'); // Your secret API key
$databases = new Databases($client);
$result = $databases->createDatetimeAttribute(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '',
required: false,
default: '', // optional
array: false // optional
);
@@ -0,0 +1,20 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Databases;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setSession('') // The user session to authenticate with
->setKey('<YOUR_API_KEY>') // Your secret API key
->setJWT('<YOUR_JWT>'); // Your secret JSON Web Token
$databases = new Databases($client);
$result = $databases->createDocument(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
documentId: '<DOCUMENT_ID>',
data: [],
permissions: ["read("any")"] // optional
);
@@ -0,0 +1,17 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Databases;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setAdmin('') //
->setKey('<YOUR_API_KEY>'); // Your secret API key
$databases = new Databases($client);
$result = $databases->createDocuments(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
documents: []
);
@@ -0,0 +1,20 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Databases;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setKey('<YOUR_API_KEY>'); // Your secret API key
$databases = new Databases($client);
$result = $databases->createEmailAttribute(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '',
required: false,
default: 'email@example.com', // optional
array: false // optional
);
@@ -0,0 +1,21 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Databases;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setKey('<YOUR_API_KEY>'); // Your secret API key
$databases = new Databases($client);
$result = $databases->createEnumAttribute(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '',
elements: [],
required: false,
default: '<DEFAULT>', // optional
array: false // optional
);
@@ -0,0 +1,22 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Databases;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setKey('<YOUR_API_KEY>'); // Your secret API key
$databases = new Databases($client);
$result = $databases->createFloatAttribute(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '',
required: false,
min: null, // optional
max: null, // optional
default: null, // optional
array: false // optional
);
@@ -0,0 +1,22 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Databases;
use Appwrite\Enums\IndexType;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setKey('<YOUR_API_KEY>'); // Your secret API key
$databases = new Databases($client);
$result = $databases->createIndex(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '',
type: IndexType::KEY(),
attributes: [],
orders: [], // optional
lengths: [] // optional
);
@@ -0,0 +1,22 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Databases;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setKey('<YOUR_API_KEY>'); // Your secret API key
$databases = new Databases($client);
$result = $databases->createIntegerAttribute(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '',
required: false,
min: null, // optional
max: null, // optional
default: null, // optional
array: false // optional
);
@@ -0,0 +1,20 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Databases;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setKey('<YOUR_API_KEY>'); // Your secret API key
$databases = new Databases($client);
$result = $databases->createIpAttribute(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '',
required: false,
default: '', // optional
array: false // optional
);
@@ -0,0 +1,23 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Databases;
use Appwrite\Enums\RelationshipType;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setKey('<YOUR_API_KEY>'); // Your secret API key
$databases = new Databases($client);
$result = $databases->createRelationshipAttribute(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
relatedCollectionId: '<RELATED_COLLECTION_ID>',
type: RelationshipType::ONETOONE(),
twoWay: false, // optional
key: '', // optional
twoWayKey: '', // optional
onDelete: RelationMutate::CASCADE() // optional
);
@@ -0,0 +1,22 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Databases;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setKey('<YOUR_API_KEY>'); // Your secret API key
$databases = new Databases($client);
$result = $databases->createStringAttribute(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '',
size: 1,
required: false,
default: '<DEFAULT>', // optional
array: false, // optional
encrypt: false // optional
);
@@ -0,0 +1,20 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Databases;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setKey('<YOUR_API_KEY>'); // Your secret API key
$databases = new Databases($client);
$result = $databases->createUrlAttribute(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '',
required: false,
default: 'https://example.com', // optional
array: false // optional
);
@@ -0,0 +1,17 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Databases;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setKey('<YOUR_API_KEY>'); // Your secret API key
$databases = new Databases($client);
$result = $databases->create(
databaseId: '<DATABASE_ID>',
name: '<NAME>',
enabled: false // optional
);
@@ -0,0 +1,20 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Databases;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setKey('<YOUR_API_KEY>'); // Your secret API key
$databases = new Databases($client);
$result = $databases->decrementDocumentAttribute(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
documentId: '<DOCUMENT_ID>',
attribute: '',
value: null, // optional
min: null // optional
);
@@ -0,0 +1,17 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Databases;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setKey('<YOUR_API_KEY>'); // Your secret API key
$databases = new Databases($client);
$result = $databases->deleteAttribute(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: ''
);
@@ -0,0 +1,16 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Databases;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setKey('<YOUR_API_KEY>'); // Your secret API key
$databases = new Databases($client);
$result = $databases->deleteCollection(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>'
);
@@ -0,0 +1,17 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Databases;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setSession(''); // The user session to authenticate with
$databases = new Databases($client);
$result = $databases->deleteDocument(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
documentId: '<DOCUMENT_ID>'
);
@@ -0,0 +1,17 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Databases;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setKey('<YOUR_API_KEY>'); // Your secret API key
$databases = new Databases($client);
$result = $databases->deleteDocuments(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
queries: [] // optional
);
@@ -0,0 +1,17 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Databases;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setKey('<YOUR_API_KEY>'); // Your secret API key
$databases = new Databases($client);
$result = $databases->deleteIndex(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: ''
);
@@ -0,0 +1,15 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Databases;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setKey('<YOUR_API_KEY>'); // Your secret API key
$databases = new Databases($client);
$result = $databases->delete(
databaseId: '<DATABASE_ID>'
);
@@ -0,0 +1,17 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Databases;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setKey('<YOUR_API_KEY>'); // Your secret API key
$databases = new Databases($client);
$result = $databases->getAttribute(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: ''
);
@@ -0,0 +1,16 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Databases;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setKey('<YOUR_API_KEY>'); // Your secret API key
$databases = new Databases($client);
$result = $databases->getCollection(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>'
);
@@ -0,0 +1,18 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Databases;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setSession(''); // The user session to authenticate with
$databases = new Databases($client);
$result = $databases->getDocument(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
documentId: '<DOCUMENT_ID>',
queries: [] // optional
);
@@ -0,0 +1,17 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Databases;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setKey('<YOUR_API_KEY>'); // Your secret API key
$databases = new Databases($client);
$result = $databases->getIndex(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: ''
);
@@ -0,0 +1,15 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Databases;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setKey('<YOUR_API_KEY>'); // Your secret API key
$databases = new Databases($client);
$result = $databases->get(
databaseId: '<DATABASE_ID>'
);
@@ -0,0 +1,20 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Databases;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setKey('<YOUR_API_KEY>'); // Your secret API key
$databases = new Databases($client);
$result = $databases->incrementDocumentAttribute(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
documentId: '<DOCUMENT_ID>',
attribute: '',
value: null, // optional
max: null // optional
);
@@ -0,0 +1,17 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Databases;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setKey('<YOUR_API_KEY>'); // Your secret API key
$databases = new Databases($client);
$result = $databases->listAttributes(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
queries: [] // optional
);
@@ -0,0 +1,17 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Databases;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setKey('<YOUR_API_KEY>'); // Your secret API key
$databases = new Databases($client);
$result = $databases->listCollections(
databaseId: '<DATABASE_ID>',
queries: [], // optional
search: '<SEARCH>' // optional
);
@@ -0,0 +1,17 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Databases;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setSession(''); // The user session to authenticate with
$databases = new Databases($client);
$result = $databases->listDocuments(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
queries: [] // optional
);
@@ -0,0 +1,17 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Databases;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setKey('<YOUR_API_KEY>'); // Your secret API key
$databases = new Databases($client);
$result = $databases->listIndexes(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
queries: [] // optional
);
@@ -0,0 +1,16 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Databases;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setKey('<YOUR_API_KEY>'); // Your secret API key
$databases = new Databases($client);
$result = $databases->list(
queries: [], // optional
search: '<SEARCH>' // optional
);
@@ -0,0 +1,20 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Databases;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setKey('<YOUR_API_KEY>'); // Your secret API key
$databases = new Databases($client);
$result = $databases->updateBooleanAttribute(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '',
required: false,
default: false,
newKey: '' // optional
);
@@ -0,0 +1,20 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Databases;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setKey('<YOUR_API_KEY>'); // Your secret API key
$databases = new Databases($client);
$result = $databases->updateCollection(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
name: '<NAME>',
permissions: ["read("any")"], // optional
documentSecurity: false, // optional
enabled: false // optional
);
@@ -0,0 +1,20 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Databases;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setKey('<YOUR_API_KEY>'); // Your secret API key
$databases = new Databases($client);
$result = $databases->updateDatetimeAttribute(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '',
required: false,
default: '',
newKey: '' // optional
);
@@ -0,0 +1,19 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Databases;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setSession(''); // The user session to authenticate with
$databases = new Databases($client);
$result = $databases->updateDocument(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
documentId: '<DOCUMENT_ID>',
data: [], // optional
permissions: ["read("any")"] // optional
);
@@ -0,0 +1,18 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Databases;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setKey('<YOUR_API_KEY>'); // Your secret API key
$databases = new Databases($client);
$result = $databases->updateDocuments(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
data: [], // optional
queries: [] // optional
);
@@ -0,0 +1,20 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Databases;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setKey('<YOUR_API_KEY>'); // Your secret API key
$databases = new Databases($client);
$result = $databases->updateEmailAttribute(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '',
required: false,
default: 'email@example.com',
newKey: '' // optional
);
@@ -0,0 +1,21 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Databases;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setKey('<YOUR_API_KEY>'); // Your secret API key
$databases = new Databases($client);
$result = $databases->updateEnumAttribute(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '',
elements: [],
required: false,
default: '<DEFAULT>',
newKey: '' // optional
);
@@ -0,0 +1,22 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Databases;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setKey('<YOUR_API_KEY>'); // Your secret API key
$databases = new Databases($client);
$result = $databases->updateFloatAttribute(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '',
required: false,
default: null,
min: null, // optional
max: null, // optional
newKey: '' // optional
);
@@ -0,0 +1,22 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Databases;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setKey('<YOUR_API_KEY>'); // Your secret API key
$databases = new Databases($client);
$result = $databases->updateIntegerAttribute(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '',
required: false,
default: null,
min: null, // optional
max: null, // optional
newKey: '' // optional
);
@@ -0,0 +1,20 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Databases;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setKey('<YOUR_API_KEY>'); // Your secret API key
$databases = new Databases($client);
$result = $databases->updateIpAttribute(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '',
required: false,
default: '',
newKey: '' // optional
);
@@ -0,0 +1,19 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Databases;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setKey('<YOUR_API_KEY>'); // Your secret API key
$databases = new Databases($client);
$result = $databases->updateRelationshipAttribute(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '',
onDelete: RelationMutate::CASCADE(), // optional
newKey: '' // optional
);
@@ -0,0 +1,21 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Databases;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setKey('<YOUR_API_KEY>'); // Your secret API key
$databases = new Databases($client);
$result = $databases->updateStringAttribute(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '',
required: false,
default: '<DEFAULT>',
size: 1, // optional
newKey: '' // optional
);
@@ -0,0 +1,20 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Databases;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setKey('<YOUR_API_KEY>'); // Your secret API key
$databases = new Databases($client);
$result = $databases->updateUrlAttribute(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '',
required: false,
default: 'https://example.com',
newKey: '' // optional
);
@@ -0,0 +1,17 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Databases;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setKey('<YOUR_API_KEY>'); // Your secret API key
$databases = new Databases($client);
$result = $databases->update(
databaseId: '<DATABASE_ID>',
name: '<NAME>',
enabled: false // optional
);
@@ -0,0 +1,18 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Databases;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setSession('') // The user session to authenticate with
->setKey('<YOUR_API_KEY>') // Your secret API key
->setJWT('<YOUR_JWT>'); // Your secret JSON Web Token
$databases = new Databases($client);
$result = $databases->upsertDocument(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
documentId: '<DOCUMENT_ID>'
);
@@ -0,0 +1,16 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Databases;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setAdmin('') //
->setKey('<YOUR_API_KEY>'); // Your secret API key
$databases = new Databases($client);
$result = $databases->upsertDocuments(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>'
);
@@ -0,0 +1,20 @@
<?php
use Appwrite\Client;
use Appwrite\InputFile;
use Appwrite\Services\Functions;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setKey('<YOUR_API_KEY>'); // Your secret API key
$functions = new Functions($client);
$result = $functions->createDeployment(
functionId: '<FUNCTION_ID>',
code: InputFile::withPath('file.png'),
activate: false,
entrypoint: '<ENTRYPOINT>', // optional
commands: '<COMMANDS>' // optional
);

Some files were not shown because too many files have changed in this diff Show More