Skip to content

Commit

Permalink
Merge pull request #21 from appwrite/dev
Browse files Browse the repository at this point in the history
feat: release 1.4.x
  • Loading branch information
christyjacob4 committed Aug 30, 2023
2 parents 2b9e966 + 9ab1875 commit 48d84b8
Show file tree
Hide file tree
Showing 188 changed files with 1,240 additions and 558 deletions.
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.3.0-blue.svg?style=flat-square&v=1)
![Version](https://img.shields.io/badge/api%20version-1.4.0-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.3.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-php/releases).**
**This SDK is compatible with Appwrite server version 1.4.x. 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 abstract and simplify 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
39 changes: 33 additions & 6 deletions docs/account.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
GET https://HOSTNAME/v1/account
```

** Get currently logged in user data as JSON object. **
** Get the currently logged in user. **

## Update Email

Expand All @@ -25,13 +25,41 @@ This endpoint can also be used to convert an anonymous account to a normal one,
| email | string | User email. | |
| password | string | User password. Must be at least 8 chars. | |

## List Identities

```http request
GET https://HOSTNAME/v1/account/identities
```

** Get the list of identities for the currently logged in user. **

### Parameters

| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| queries | string | 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. You may filter on the following attributes: userId, provider, providerUid, providerEmail, providerAccessTokenExpiry | [] |

## Delete Identity

```http request
DELETE https://HOSTNAME/v1/account/identities/{identityId}
```

** Delete an identity by its unique ID. **

### Parameters

| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| identityId | string | **Required** Identity ID. | |

## List Logs

```http request
GET https://HOSTNAME/v1/account/logs
```

** Get currently logged in user list of latest security activity logs. Each log returns user IP address, location and date and time of log. **
** Get the list of latest security activity logs for the currently logged in user. Each log returns user IP address, location and date and time of log. **

### Parameters

Expand Down Expand Up @@ -89,7 +117,7 @@ PATCH https://HOSTNAME/v1/account/phone
GET https://HOSTNAME/v1/account/prefs
```

** Get currently logged in user preferences as a key-value object. **
** Get the preferences as a key-value object for the currently logged in user. **

## Update Preferences

Expand Down Expand Up @@ -145,7 +173,7 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/
GET https://HOSTNAME/v1/account/sessions
```

** Get currently logged in user list of active sessions across different devices. **
** Get the list of active sessions across different devices for the currently logged in user. **

## Delete Sessions

Expand Down Expand Up @@ -189,8 +217,7 @@ PATCH https://HOSTNAME/v1/account/sessions/{sessionId}
DELETE https://HOSTNAME/v1/account/sessions/{sessionId}
```

** Use this endpoint to log out the currently logged in user from all their account sessions across all of their different devices. When using the Session ID argument, only the unique session ID provided is deleted.
**
** Logout the user. Use 'current' as the session ID to logout on this device, use a session ID to logout on another device. If you're looking to logout the user on all devices, use [Delete Sessions](/docs/client/account#accountDeleteSessions) instead. **

### Parameters

Expand Down
14 changes: 10 additions & 4 deletions docs/databases.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ POST https://HOSTNAME/v1/databases
| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| databaseId | 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. | |
| name | string | Collection name. Max length: 128 chars. | |
| name | string | Database name. Max length: 128 chars. | |
| enabled | boolean | Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. | 1 |

## Get Database

Expand Down Expand Up @@ -59,6 +60,7 @@ PUT https://HOSTNAME/v1/databases/{databaseId}
| --- | --- | --- | --- |
| databaseId | string | **Required** Database ID. | |
| name | string | Database name. Max length: 128 chars. | |
| enabled | boolean | Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. | 1 |

## Delete Database

Expand Down Expand Up @@ -107,6 +109,7 @@ POST https://HOSTNAME/v1/databases/{databaseId}/collections
| name | string | Collection name. Max length: 128 chars. | |
| permissions | array | An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](/docs/permissions). | |
| documentSecurity | boolean | Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](/docs/permissions). | |
| enabled | boolean | Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled. | 1 |

## Get Collection

Expand Down Expand Up @@ -140,7 +143,7 @@ PUT https://HOSTNAME/v1/databases/{databaseId}/collections/{collectionId}
| name | string | Collection name. Max length: 128 chars. | |
| permissions | array | An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](/docs/permissions). | |
| documentSecurity | boolean | Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](/docs/permissions). | |
| enabled | boolean | Is collection enabled? | 1 |
| enabled | boolean | Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled. | 1 |

## Delete Collection

Expand Down Expand Up @@ -169,6 +172,7 @@ GET https://HOSTNAME/v1/databases/{databaseId}/collections/{collectionId}/attrib
| --- | --- | --- | --- |
| databaseId | string | **Required** Database ID. | |
| collectionId | string | **Required** Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). | |
| 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. You may filter on the following attributes: key, type, size, required, array, status, error | [] |

## Create Boolean Attribute

Expand Down Expand Up @@ -447,7 +451,7 @@ PATCH https://HOSTNAME/v1/databases/{databaseId}/collections/{collectionId}/attr
POST https://HOSTNAME/v1/databases/{databaseId}/collections/{collectionId}/attributes/relationship
```

** Create relationship attribute. [Learn more about relationship attributes](docs/databases-relationships#relationship-attributes).
** Create relationship attribute. [Learn more about relationship attributes](/docs/databases-relationships#relationship-attributes).
**

### Parameters
Expand Down Expand Up @@ -483,6 +487,7 @@ POST https://HOSTNAME/v1/databases/{databaseId}/collections/{collectionId}/attri
| required | boolean | Is attribute required? | |
| default | string | Default value for attribute when not provided. Cannot be set when attribute is required. | |
| array | boolean | Is attribute an array? | |
| encrypt | boolean | Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried. | |

## Update String Attribute

Expand Down Expand Up @@ -576,7 +581,7 @@ DELETE https://HOSTNAME/v1/databases/{databaseId}/collections/{collectionId}/att
PATCH https://HOSTNAME/v1/databases/{databaseId}/collections/{collectionId}/attributes/{key}/relationship
```

** Update relationship attribute. [Learn more about relationship attributes](docs/databases-relationships#relationship-attributes).
** Update relationship attribute. [Learn more about relationship attributes](/docs/databases-relationships#relationship-attributes).
**

### Parameters
Expand Down Expand Up @@ -685,6 +690,7 @@ GET https://HOSTNAME/v1/databases/{databaseId}/collections/{collectionId}/indexe
| --- | --- | --- | --- |
| databaseId | string | **Required** Database ID. | |
| collectionId | string | **Required** Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). | |
| 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. You may filter on the following attributes: key, type, status, attributes, error | [] |

## Create Index

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/account/create-phone-verification.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use Appwrite\Services\Account;
$client = new Client();
$client
->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
->setProject('5df5acd0d48c2') // Your project ID
->setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
;
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/account/create-recovery.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use Appwrite\Services\Account;
$client = new Client();
$client
->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
->setProject('5df5acd0d48c2') // Your project ID
->setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
;
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/account/create-verification.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use Appwrite\Services\Account;
$client = new Client();
$client
->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
->setProject('5df5acd0d48c2') // Your project ID
->setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
;
Expand Down
16 changes: 16 additions & 0 deletions docs/examples/account/delete-identity.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Account;
$client = new Client();
$client
->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
->setProject('5df5acd0d48c2') // Your project ID
->setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
;

$account = new Account($client);

$result = $account->deleteIdentity('[IDENTITY_ID]');
2 changes: 1 addition & 1 deletion docs/examples/account/delete-session.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use Appwrite\Services\Account;
$client = new Client();
$client
->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
->setProject('5df5acd0d48c2') // Your project ID
->setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
;
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/account/delete-sessions.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use Appwrite\Services\Account;
$client = new Client();
$client
->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
->setProject('5df5acd0d48c2') // Your project ID
->setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
;
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/account/get-prefs.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use Appwrite\Services\Account;
$client = new Client();
$client
->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
->setProject('5df5acd0d48c2') // Your project ID
->setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
;
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/account/get-session.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use Appwrite\Services\Account;
$client = new Client();
$client
->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
->setProject('5df5acd0d48c2') // Your project ID
->setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
;
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/account/get.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use Appwrite\Services\Account;
$client = new Client();
$client
->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
->setProject('5df5acd0d48c2') // Your project ID
->setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
;
Expand Down
16 changes: 16 additions & 0 deletions docs/examples/account/list-identities.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php
use Appwrite\Client;
use Appwrite\Services\Account;
$client = new Client();
$client
->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
->setProject('5df5acd0d48c2') // Your project ID
->setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
;

$account = new Account($client);

$result = $account->listIdentities();
2 changes: 1 addition & 1 deletion docs/examples/account/list-logs.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use Appwrite\Services\Account;
$client = new Client();
$client
->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
->setProject('5df5acd0d48c2') // Your project ID
->setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
;
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/account/list-sessions.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use Appwrite\Services\Account;
$client = new Client();
$client
->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
->setProject('5df5acd0d48c2') // Your project ID
->setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
;
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/account/update-email.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use Appwrite\Services\Account;
$client = new Client();
$client
->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
->setProject('5df5acd0d48c2') // Your project ID
->setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
;
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/account/update-name.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use Appwrite\Services\Account;
$client = new Client();
$client
->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
->setProject('5df5acd0d48c2') // Your project ID
->setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
;
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/account/update-password.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use Appwrite\Services\Account;
$client = new Client();
$client
->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
->setProject('5df5acd0d48c2') // Your project ID
->setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
;
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/account/update-phone-verification.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use Appwrite\Services\Account;
$client = new Client();
$client
->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
->setProject('5df5acd0d48c2') // Your project ID
->setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
;
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/account/update-phone.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use Appwrite\Services\Account;
$client = new Client();
$client
->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
->setProject('5df5acd0d48c2') // Your project ID
->setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
;
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/account/update-prefs.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use Appwrite\Services\Account;
$client = new Client();
$client
->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
->setProject('5df5acd0d48c2') // Your project ID
->setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
;
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/account/update-recovery.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use Appwrite\Services\Account;
$client = new Client();
$client
->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
->setProject('5df5acd0d48c2') // Your project ID
->setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
;
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/account/update-session.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use Appwrite\Services\Account;
$client = new Client();
$client
->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
->setProject('5df5acd0d48c2') // Your project ID
->setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
;
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/account/update-status.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use Appwrite\Services\Account;
$client = new Client();
$client
->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
->setProject('5df5acd0d48c2') // Your project ID
->setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
;
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/account/update-verification.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use Appwrite\Services\Account;
$client = new Client();
$client
->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
->setProject('5df5acd0d48c2') // Your project ID
->setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
;
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/avatars/get-browser.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use Appwrite\Services\Avatars;
$client = new Client();
$client
->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
->setProject('5df5acd0d48c2') // Your project ID
->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
;
Expand Down
Loading

0 comments on commit 48d84b8

Please sign in to comment.