Skip to content
Open
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Change Log

## 23.1.0

* Added: Introduced `bigint` create/update APIs for legacy Databases attributes
* Added: Introduced `bigint` create/update APIs for `TablesDB` columns
* Updated: Extended key-list query filters with `key`, `resourceType`, `resourceId`, and `secret`

## 23.0.0

* [BREAKING] Renamed Webhook model fields: `security` → `tls`, `httpUser` → `authUsername`, `httpPass` → `authPassword`, `signatureKey` → `secret`
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Appwrite PHP SDK

![License](https://img.shields.io/github/license/appwrite/sdk-for-php.svg?style=flat-square&v=1)
![Version](https://img.shields.io/badge/api%20version-1.9.1-blue.svg?style=flat-square&v=1)
![Version](https://img.shields.io/badge/api%20version-1.9.4-blue.svg?style=flat-square&v=1)
[![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator)
[![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.9.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
2 changes: 1 addition & 1 deletion docs/account.md
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about

| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| provider | string | **Required** OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, x, yahoo, yammer, yandex, zoho, zoom. | |
| provider | string | **Required** OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, fusionauth, github, gitlab, google, keycloak, kick, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, x, yahoo, yammer, yandex, zoho, zoom. | |
| success | string | URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. | |
| failure | string | URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. | |
| scopes | array | A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long. | [] |
Expand Down
42 changes: 42 additions & 0 deletions docs/databases.md
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,48 @@ GET https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collectionI
| total | boolean | When set to false, the total count returned will be 0 and will not be calculated. | 1 |


```http request
POST https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collectionId}/attributes/bigint
```

** Create a bigint attribute. Optionally, minimum and maximum values can be provided.
**

### Parameters

| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| databaseId | string | **Required** Database ID. | |
| collectionId | string | **Required** Collection ID. | |
| key | string | Attribute Key. | |
| required | boolean | Is attribute required? | |
| min | integer | Minimum value | |
| max | integer | Maximum value | |
| default | integer | Default value. Cannot be set when attribute is required. | |
| array | boolean | Is attribute an array? | |


```http request
PATCH https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collectionId}/attributes/bigint/{key}
```

** Update a bigint attribute. Changing the `default` value will not update already existing documents.
**

### Parameters

| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| databaseId | string | **Required** Database ID. | |
| collectionId | string | **Required** Collection ID. | |
| key | string | **Required** Attribute Key. | |
| required | boolean | Is attribute required? | |
| min | integer | Minimum value | |
| max | integer | Maximum value | |
| default | integer | Default value. Cannot be set when attribute is required. | |
| newKey | string | New Attribute Key. | |


```http request
POST https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collectionId}/attributes/boolean
```
Expand Down
23 changes: 23 additions & 0 deletions docs/examples/databases/create-big-int-attribute.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
```php
<?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->createBigIntAttribute(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '',
required: false,
min: null, // optional
max: null, // optional
default: null, // optional
array: false // optional
);```
23 changes: 23 additions & 0 deletions docs/examples/databases/update-big-int-attribute.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
```php
<?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->updateBigIntAttribute(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '',
required: false,
default: null,
min: null, // optional
max: null, // optional
newKey: '' // optional
);```
1 change: 1 addition & 0 deletions docs/examples/functions/create-variable.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ $functions = new Functions($client);

$result = $functions->createVariable(
functionId: '<FUNCTION_ID>',
variableId: '<VARIABLE_ID>',
key: '<KEY>',
value: '<VALUE>',
secret: false // optional
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/functions/create.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ $result = $functions->create(
logging: false, // optional
entrypoint: '<ENTRYPOINT>', // optional
commands: '<COMMANDS>', // optional
scopes: [Scopes::SESSIONSWRITE()], // optional
scopes: [Scopes::PROJECTREAD()], // optional
installationId: '<INSTALLATION_ID>', // optional
providerRepositoryId: '<PROVIDER_REPOSITORY_ID>', // optional
providerBranch: '<PROVIDER_BRANCH>', // optional
Expand Down
4 changes: 3 additions & 1 deletion docs/examples/functions/list-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,7 @@ $client = (new Client())
$functions = new Functions($client);

$result = $functions->listVariables(
functionId: '<FUNCTION_ID>'
functionId: '<FUNCTION_ID>',
queries: [], // optional
total: false // optional
);```
2 changes: 1 addition & 1 deletion docs/examples/functions/update-variable.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ $functions = new Functions($client);
$result = $functions->updateVariable(
functionId: '<FUNCTION_ID>',
variableId: '<VARIABLE_ID>',
key: '<KEY>',
key: '<KEY>', // optional
value: '<VALUE>', // optional
secret: false // optional
);```
2 changes: 1 addition & 1 deletion docs/examples/functions/update.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ $result = $functions->update(
logging: false, // optional
entrypoint: '<ENTRYPOINT>', // optional
commands: '<COMMANDS>', // optional
scopes: [Scopes::SESSIONSWRITE()], // optional
scopes: [Scopes::PROJECTREAD()], // optional
installationId: '<INSTALLATION_ID>', // optional
providerRepositoryId: '<PROVIDER_REPOSITORY_ID>', // optional
providerBranch: '<PROVIDER_BRANCH>', // optional
Expand Down
16 changes: 16 additions & 0 deletions docs/examples/presences/delete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
```php
<?php

use Appwrite\Client;
use Appwrite\Services\Presences;

$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

$presences = new Presences($client);

$result = $presences->delete(
presenceId: '<PRESENCE_ID>'
);```
16 changes: 16 additions & 0 deletions docs/examples/presences/get.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
```php
<?php

use Appwrite\Client;
use Appwrite\Services\Presences;

$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

$presences = new Presences($client);

$result = $presences->get(
presenceId: '<PRESENCE_ID>'
);```
18 changes: 18 additions & 0 deletions docs/examples/presences/list.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
```php
<?php

use Appwrite\Client;
use Appwrite\Services\Presences;

$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

$presences = new Presences($client);

$result = $presences->list(
queries: [], // optional
total: false, // optional
ttl: 0 // optional
);```
24 changes: 24 additions & 0 deletions docs/examples/presences/update-presence.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
```php
<?php

use Appwrite\Client;
use Appwrite\Services\Presences;
use Appwrite\Permission;
use Appwrite\Role;

$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

$presences = new Presences($client);

$result = $presences->updatePresence(
presenceId: '<PRESENCE_ID>',
userId: '<USER_ID>',
status: '<STATUS>', // optional
expiresAt: '2020-10-15T06:38:00.000+00:00', // optional
metadata: [], // optional
permissions: [Permission::read(Role::any())], // optional
purge: false // optional
);```
23 changes: 23 additions & 0 deletions docs/examples/presences/upsert.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
```php
<?php

use Appwrite\Client;
use Appwrite\Services\Presences;
use Appwrite\Permission;
use Appwrite\Role;

$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

$presences = new Presences($client);

$result = $presences->upsert(
presenceId: '<PRESENCE_ID>',
userId: '<USER_ID>',
status: '<STATUS>',
permissions: [Permission::read(Role::any())], // optional
expiresAt: '2020-10-15T06:38:00.000+00:00', // optional
metadata: [] // optional
);```
18 changes: 18 additions & 0 deletions docs/examples/project/create-ephemeral-key.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
```php
<?php

use Appwrite\Client;
use Appwrite\Services\Project;
use Appwrite\Enums\Scopes;

$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

$project = new Project($client);

$result = $project->createEphemeralKey(
scopes: [Scopes::PROJECTREAD()],
duration: 600
);```
2 changes: 1 addition & 1 deletion docs/examples/project/create-key.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ $project = new Project($client);
$result = $project->createKey(
keyId: '<KEY_ID>',
name: '<NAME>',
scopes: [Scopes::SESSIONSWRITE()],
scopes: [Scopes::PROJECTREAD()],
expire: '2020-10-15T06:38:00.000+00:00' // optional
);```
17 changes: 17 additions & 0 deletions docs/examples/project/create-mock-phone.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
```php
<?php

use Appwrite\Client;
use Appwrite\Services\Project;

$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

$project = new Project($client);

$result = $project->createMockPhone(
number: '+12065550100',
otp: '<OTP>'
);```
16 changes: 16 additions & 0 deletions docs/examples/project/create-smtp-test.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
```php
<?php

use Appwrite\Client;
use Appwrite\Services\Project;

$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

$project = new Project($client);

$result = $project->createSMTPTest(
emails: []
);```
16 changes: 16 additions & 0 deletions docs/examples/project/delete-mock-phone.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
```php
<?php

use Appwrite\Client;
use Appwrite\Services\Project;

$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

$project = new Project($client);

$result = $project->deleteMockPhone(
number: '+12065550100'
);```
15 changes: 15 additions & 0 deletions docs/examples/project/delete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
```php
<?php

use Appwrite\Client;
use Appwrite\Services\Project;

$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

$project = new Project($client);

$result = $project->delete();
```
19 changes: 19 additions & 0 deletions docs/examples/project/get-email-template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
```php
<?php

use Appwrite\Client;
use Appwrite\Services\Project;
use Appwrite\Enums\EmailTemplateType;
use Appwrite\Enums\EmailTemplateLocale;

$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

$project = new Project($client);

$result = $project->getEmailTemplate(
templateId: EmailTemplateType::VERIFICATION(),
locale: EmailTemplateLocale::AF() // optional
);```
Loading
Loading