Skip to content

Commit 48d84b8

Browse files
Merge pull request #21 from appwrite/dev
feat: release 1.4.x
2 parents 2b9e966 + 9ab1875 commit 48d84b8

File tree

188 files changed

+1240
-558
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

188 files changed

+1240
-558
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Appwrite PHP SDK
22

33
![License](https://img.shields.io/github/license/appwrite/sdk-for-php.svg?style=flat-square&v=1)
4-
![Version](https://img.shields.io/badge/api%20version-1.3.0-blue.svg?style=flat-square&v=1)
4+
![Version](https://img.shields.io/badge/api%20version-1.4.0-blue.svg?style=flat-square&v=1)
55
[![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator)
66
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite)
77
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)
88

9-
**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).**
9+
**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).**
1010

1111
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)
1212

docs/account.md

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
GET https://HOSTNAME/v1/account
77
```
88

9-
** Get currently logged in user data as JSON object. **
9+
** Get the currently logged in user. **
1010

1111
## Update Email
1212

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

28+
## List Identities
29+
30+
```http request
31+
GET https://HOSTNAME/v1/account/identities
32+
```
33+
34+
** Get the list of identities for the currently logged in user. **
35+
36+
### Parameters
37+
38+
| Field Name | Type | Description | Default |
39+
| --- | --- | --- | --- |
40+
| 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 | [] |
41+
42+
## Delete Identity
43+
44+
```http request
45+
DELETE https://HOSTNAME/v1/account/identities/{identityId}
46+
```
47+
48+
** Delete an identity by its unique ID. **
49+
50+
### Parameters
51+
52+
| Field Name | Type | Description | Default |
53+
| --- | --- | --- | --- |
54+
| identityId | string | **Required** Identity ID. | |
55+
2856
## List Logs
2957

3058
```http request
3159
GET https://HOSTNAME/v1/account/logs
3260
```
3361

34-
** Get currently logged in user list of latest security activity logs. Each log returns user IP address, location and date and time of log. **
62+
** 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. **
3563

3664
### Parameters
3765

@@ -89,7 +117,7 @@ PATCH https://HOSTNAME/v1/account/phone
89117
GET https://HOSTNAME/v1/account/prefs
90118
```
91119

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

94122
## Update Preferences
95123

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

148-
** Get currently logged in user list of active sessions across different devices. **
176+
** Get the list of active sessions across different devices for the currently logged in user. **
149177

150178
## Delete Sessions
151179

@@ -189,8 +217,7 @@ PATCH https://HOSTNAME/v1/account/sessions/{sessionId}
189217
DELETE https://HOSTNAME/v1/account/sessions/{sessionId}
190218
```
191219

192-
** 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.
193-
**
220+
** 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. **
194221

195222
### Parameters
196223

docs/databases.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ POST https://HOSTNAME/v1/databases
2929
| Field Name | Type | Description | Default |
3030
| --- | --- | --- | --- |
3131
| 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. | |
32-
| name | string | Collection name. Max length: 128 chars. | |
32+
| name | string | Database name. Max length: 128 chars. | |
33+
| 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 |
3334

3435
## Get Database
3536

@@ -59,6 +60,7 @@ PUT https://HOSTNAME/v1/databases/{databaseId}
5960
| --- | --- | --- | --- |
6061
| databaseId | string | **Required** Database ID. | |
6162
| name | string | Database name. Max length: 128 chars. | |
63+
| 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 |
6264

6365
## Delete Database
6466

@@ -107,6 +109,7 @@ POST https://HOSTNAME/v1/databases/{databaseId}/collections
107109
| name | string | Collection name. Max length: 128 chars. | |
108110
| permissions | array | An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](/docs/permissions). | |
109111
| 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). | |
112+
| 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 |
110113

111114
## Get Collection
112115

@@ -140,7 +143,7 @@ PUT https://HOSTNAME/v1/databases/{databaseId}/collections/{collectionId}
140143
| name | string | Collection name. Max length: 128 chars. | |
141144
| permissions | array | An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](/docs/permissions). | |
142145
| 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). | |
143-
| enabled | boolean | Is collection enabled? | 1 |
146+
| 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 |
144147

145148
## Delete Collection
146149

@@ -169,6 +172,7 @@ GET https://HOSTNAME/v1/databases/{databaseId}/collections/{collectionId}/attrib
169172
| --- | --- | --- | --- |
170173
| databaseId | string | **Required** Database ID. | |
171174
| collectionId | string | **Required** Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). | |
175+
| 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 | [] |
172176

173177
## Create Boolean Attribute
174178

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

450-
** Create relationship attribute. [Learn more about relationship attributes](docs/databases-relationships#relationship-attributes).
454+
** Create relationship attribute. [Learn more about relationship attributes](/docs/databases-relationships#relationship-attributes).
451455
**
452456

453457
### Parameters
@@ -483,6 +487,7 @@ POST https://HOSTNAME/v1/databases/{databaseId}/collections/{collectionId}/attri
483487
| required | boolean | Is attribute required? | |
484488
| default | string | Default value for attribute when not provided. Cannot be set when attribute is required. | |
485489
| array | boolean | Is attribute an array? | |
490+
| 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. | |
486491

487492
## Update String Attribute
488493

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

579-
** Update relationship attribute. [Learn more about relationship attributes](docs/databases-relationships#relationship-attributes).
584+
** Update relationship attribute. [Learn more about relationship attributes](/docs/databases-relationships#relationship-attributes).
580585
**
581586

582587
### Parameters
@@ -685,6 +690,7 @@ GET https://HOSTNAME/v1/databases/{databaseId}/collections/{collectionId}/indexe
685690
| --- | --- | --- | --- |
686691
| databaseId | string | **Required** Database ID. | |
687692
| collectionId | string | **Required** Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). | |
693+
| 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 | [] |
688694

689695
## Create Index
690696

docs/examples/account/create-phone-verification.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use Appwrite\Services\Account;
66
$client = new Client();
77
88
$client
9-
->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
9+
->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
1010
->setProject('5df5acd0d48c2') // Your project ID
1111
->setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
1212
;

docs/examples/account/create-recovery.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use Appwrite\Services\Account;
66
$client = new Client();
77
88
$client
9-
->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
9+
->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
1010
->setProject('5df5acd0d48c2') // Your project ID
1111
->setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
1212
;

docs/examples/account/create-verification.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use Appwrite\Services\Account;
66
$client = new Client();
77
88
$client
9-
->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
9+
->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
1010
->setProject('5df5acd0d48c2') // Your project ID
1111
->setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
1212
;
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
use Appwrite\Client;
4+
use Appwrite\Services\Account;
5+
6+
$client = new Client();
7+
8+
$client
9+
->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
10+
->setProject('5df5acd0d48c2') // Your project ID
11+
->setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
12+
;
13+
14+
$account = new Account($client);
15+
16+
$result = $account->deleteIdentity('[IDENTITY_ID]');

docs/examples/account/delete-session.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use Appwrite\Services\Account;
66
$client = new Client();
77
88
$client
9-
->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
9+
->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
1010
->setProject('5df5acd0d48c2') // Your project ID
1111
->setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
1212
;

docs/examples/account/delete-sessions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use Appwrite\Services\Account;
66
$client = new Client();
77
88
$client
9-
->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
9+
->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
1010
->setProject('5df5acd0d48c2') // Your project ID
1111
->setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
1212
;

docs/examples/account/get-prefs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use Appwrite\Services\Account;
66
$client = new Client();
77
88
$client
9-
->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
9+
->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
1010
->setProject('5df5acd0d48c2') // Your project ID
1111
->setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
1212
;

0 commit comments

Comments
 (0)