Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Change Log

## 20.1.0

* Fix doc examples with proper formatting
* Add support for the new `Backups` service

## 20.0.0

* Add array-based enum parameters (e.g., `permissions: array<BrowserPermission>`).
Expand Down Expand Up @@ -48,4 +53,4 @@
* Add `dart38` and `flutter332` support to runtime models
* Add `gif` support to `ImageFormat` enum
* Add `upsertDocument` support to `Databases` service
* Add `sequence` support to `Document` model
* Add `sequence` support to `Document` model
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite)
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)

**This SDK is compatible with Appwrite server version 1.8.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-php/releases).**
**This SDK is compatible with Appwrite server version latest. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-php/releases).**

Appwrite is an open-source backend as a service server that abstracts and simplifies complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the PHP SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)

Expand Down
172 changes: 172 additions & 0 deletions docs/backups.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
# Backups Service


```http request
GET https://cloud.appwrite.io/v1/backups/archives
```

** List all archives for a project. **

### Parameters

| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| queries | array | Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. | [] |


```http request
POST https://cloud.appwrite.io/v1/backups/archives
```

** Create a new archive asynchronously for a project. **

### Parameters

| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| services | array | Array of services to backup | |
| resourceId | string | Resource ID. When set, only this single resource will be backed up. | |


```http request
GET https://cloud.appwrite.io/v1/backups/archives/{archiveId}
```

** Get a backup archive using it&#039;s ID. **

### Parameters

| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| archiveId | string | **Required** Archive ID. Choose a custom ID`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. | |


```http request
DELETE https://cloud.appwrite.io/v1/backups/archives/{archiveId}
```

** Delete an existing archive for a project. **

### Parameters

| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| archiveId | string | **Required** Policy ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. | |


```http request
GET https://cloud.appwrite.io/v1/backups/policies
```

** List all policies for a project. **

### Parameters

| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| queries | array | Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. | [] |


```http request
POST https://cloud.appwrite.io/v1/backups/policies
```

** Create a new backup policy. **

### Parameters

| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| policyId | string | Policy ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. | |
| name | string | Policy name. Max length: 128 chars. | |
| services | array | Array of services to backup | |
| resourceId | string | Resource ID. When set, only this single resource will be backed up. | |
| enabled | boolean | Is policy enabled? When set to 'disabled', no backups will be taken | 1 |
| retention | integer | Days to keep backups before deletion | |
| schedule | string | Schedule CRON syntax. | |


```http request
GET https://cloud.appwrite.io/v1/backups/policies/{policyId}
```

** Get a backup policy using it&#039;s ID. **

### Parameters

| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| policyId | string | **Required** Policy ID. Choose a custom ID`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. | |


```http request
PATCH https://cloud.appwrite.io/v1/backups/policies/{policyId}
```

** Update an existing policy using it&#039;s ID. **

### Parameters

| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| policyId | string | **Required** Policy ID. Choose a custom ID`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. | |
| name | string | Policy name. Max length: 128 chars. | |
| retention | integer | Days to keep backups before deletion | |
| schedule | string | Cron expression | |
| enabled | boolean | Is Backup enabled? When set to 'disabled', No backup will be taken | |


```http request
DELETE https://cloud.appwrite.io/v1/backups/policies/{policyId}
```

** Delete a policy using it&#039;s ID. **

### Parameters

| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| policyId | string | **Required** Policy ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. | |


```http request
POST https://cloud.appwrite.io/v1/backups/restoration
```

** Create and trigger a new restoration for a backup on a project. **

### Parameters

| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| archiveId | string | Backup archive ID to restore | |
| services | array | Array of services to restore | |
| newResourceId | string | Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. | |
| newResourceName | string | Database name. Max length: 128 chars. | |


```http request
GET https://cloud.appwrite.io/v1/backups/restorations
```

** List all backup restorations for a project. **

### Parameters

| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| queries | array | Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. | [] |


```http request
GET https://cloud.appwrite.io/v1/backups/restorations/{restorationId}
```

** Get the current status of a backup restoration. **

### Parameters

| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| restorationId | string | **Required** Restoration ID. Choose a custom ID`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. | |

2 changes: 2 additions & 0 deletions docs/examples/account/create-anonymous-session.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
```php
<?php

use Appwrite\Client;
Expand All @@ -11,3 +12,4 @@ $client = (new Client())
$account = new Account($client);

$result = $account->createAnonymousSession();
```
3 changes: 2 additions & 1 deletion docs/examples/account/create-email-password-session.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
```php
<?php

use Appwrite\Client;
Expand All @@ -13,4 +14,4 @@ $account = new Account($client);
$result = $account->createEmailPasswordSession(
email: 'email@example.com',
password: 'password'
);
);```
3 changes: 2 additions & 1 deletion docs/examples/account/create-email-token.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
```php
<?php

use Appwrite\Client;
Expand All @@ -14,4 +15,4 @@ $result = $account->createEmailToken(
userId: '<USER_ID>',
email: 'email@example.com',
phrase: false // optional
);
);```
3 changes: 2 additions & 1 deletion docs/examples/account/create-email-verification.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
```php
<?php

use Appwrite\Client;
Expand All @@ -12,4 +13,4 @@ $account = new Account($client);

$result = $account->createEmailVerification(
url: 'https://example.com'
);
);```
3 changes: 2 additions & 1 deletion docs/examples/account/create-jwt.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
```php
<?php

use Appwrite\Client;
Expand All @@ -12,4 +13,4 @@ $account = new Account($client);

$result = $account->createJWT(
duration: 0 // optional
);
);```
3 changes: 2 additions & 1 deletion docs/examples/account/create-magic-url-token.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
```php
<?php

use Appwrite\Client;
Expand All @@ -15,4 +16,4 @@ $result = $account->createMagicURLToken(
email: 'email@example.com',
url: 'https://example.com', // optional
phrase: false // optional
);
);```
3 changes: 2 additions & 1 deletion docs/examples/account/create-mfa-authenticator.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
```php
<?php

use Appwrite\Client;
Expand All @@ -13,4 +14,4 @@ $account = new Account($client);

$result = $account->createMFAAuthenticator(
type: AuthenticatorType::TOTP()
);
);```
3 changes: 2 additions & 1 deletion docs/examples/account/create-mfa-challenge.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
```php
<?php

use Appwrite\Client;
Expand All @@ -13,4 +14,4 @@ $account = new Account($client);

$result = $account->createMFAChallenge(
factor: AuthenticationFactor::EMAIL()
);
);```
2 changes: 2 additions & 0 deletions docs/examples/account/create-mfa-recovery-codes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
```php
<?php

use Appwrite\Client;
Expand All @@ -11,3 +12,4 @@ $client = (new Client())
$account = new Account($client);

$result = $account->createMFARecoveryCodes();
```
3 changes: 2 additions & 1 deletion docs/examples/account/create-o-auth-2-token.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
```php
<?php

use Appwrite\Client;
Expand All @@ -16,4 +17,4 @@ $result = $account->createOAuth2Token(
success: 'https://example.com', // optional
failure: 'https://example.com', // optional
scopes: [] // optional
);
);```
3 changes: 2 additions & 1 deletion docs/examples/account/create-phone-token.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
```php
<?php

use Appwrite\Client;
Expand All @@ -13,4 +14,4 @@ $account = new Account($client);
$result = $account->createPhoneToken(
userId: '<USER_ID>',
phone: '+12065550100'
);
);```
2 changes: 2 additions & 0 deletions docs/examples/account/create-phone-verification.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
```php
<?php

use Appwrite\Client;
Expand All @@ -11,3 +12,4 @@ $client = (new Client())
$account = new Account($client);

$result = $account->createPhoneVerification();
```
3 changes: 2 additions & 1 deletion docs/examples/account/create-recovery.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
```php
<?php

use Appwrite\Client;
Expand All @@ -13,4 +14,4 @@ $account = new Account($client);
$result = $account->createRecovery(
email: 'email@example.com',
url: 'https://example.com'
);
);```
3 changes: 2 additions & 1 deletion docs/examples/account/create-session.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
```php
<?php

use Appwrite\Client;
Expand All @@ -13,4 +14,4 @@ $account = new Account($client);
$result = $account->createSession(
userId: '<USER_ID>',
secret: '<SECRET>'
);
);```
3 changes: 2 additions & 1 deletion docs/examples/account/create-verification.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
```php
<?php

use Appwrite\Client;
Expand All @@ -12,4 +13,4 @@ $account = new Account($client);

$result = $account->createVerification(
url: 'https://example.com'
);
);```
3 changes: 2 additions & 1 deletion docs/examples/account/create.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
```php
<?php

use Appwrite\Client;
Expand All @@ -15,4 +16,4 @@ $result = $account->create(
email: 'email@example.com',
password: '',
name: '<NAME>' // optional
);
);```
3 changes: 2 additions & 1 deletion docs/examples/account/delete-identity.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
```php
<?php

use Appwrite\Client;
Expand All @@ -12,4 +13,4 @@ $account = new Account($client);

$result = $account->deleteIdentity(
identityId: '<IDENTITY_ID>'
);
);```
Loading