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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ Redistribution and use in source and binary forms, with or without modification,

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

3. Neither the name Appwrite nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
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.0.0-blue.svg?style=flat-square&v=1)
![Version](https://img.shields.io/badge/api%20version-1.2.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.0.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.2.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
24 changes: 12 additions & 12 deletions docs/account.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ GET https://HOSTNAME/v1/account

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

## Update Account Email
## Update Email

```http request
PATCH https://HOSTNAME/v1/account/email
Expand All @@ -25,7 +25,7 @@ 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 Account Logs
## List Logs

```http request
GET https://HOSTNAME/v1/account/logs
Expand All @@ -39,7 +39,7 @@ GET https://HOSTNAME/v1/account/logs
| --- | --- | --- | --- |
| queries | array | Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Only supported methods are limit and offset | [] |

## Update Account Name
## Update Name

```http request
PATCH https://HOSTNAME/v1/account/name
Expand All @@ -53,7 +53,7 @@ PATCH https://HOSTNAME/v1/account/name
| --- | --- | --- | --- |
| name | string | User name. Max length: 128 chars. | |

## Update Account Password
## Update Password

```http request
PATCH https://HOSTNAME/v1/account/password
Expand All @@ -68,7 +68,7 @@ PATCH https://HOSTNAME/v1/account/password
| password | string | New user password. Must be at least 8 chars. | |
| oldPassword | string | Current user password. Must be at least 8 chars. | |

## Update Account Phone
## Update Phone

```http request
PATCH https://HOSTNAME/v1/account/phone
Expand All @@ -91,7 +91,7 @@ GET https://HOSTNAME/v1/account/prefs

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

## Update Account Preferences
## Update Preferences

```http request
PATCH https://HOSTNAME/v1/account/prefs
Expand Down Expand Up @@ -139,23 +139,23 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/
| password | string | New user password. Must be at least 8 chars. | |
| passwordAgain | string | Repeat new user password. Must be at least 8 chars. | |

## List Account Sessions
## List Sessions

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

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

## Delete All Account Sessions
## Delete Sessions

```http request
DELETE https://HOSTNAME/v1/account/sessions
```

** Delete all sessions from the user account and remove any sessions cookies from the end client. **

## Get Session By ID
## Get Session

```http request
GET https://HOSTNAME/v1/account/sessions/{sessionId}
Expand All @@ -169,7 +169,7 @@ GET https://HOSTNAME/v1/account/sessions/{sessionId}
| --- | --- | --- | --- |
| sessionId | string | **Required** Session ID. Use the string 'current' to get the current device session. | |

## Update Session (Refresh Tokens)
## Update OAuth Session (Refresh Tokens)

```http request
PATCH https://HOSTNAME/v1/account/sessions/{sessionId}
Expand All @@ -183,7 +183,7 @@ PATCH https://HOSTNAME/v1/account/sessions/{sessionId}
| --- | --- | --- | --- |
| sessionId | string | **Required** Session ID. Use the string 'current' to update the current device session. | |

## Delete Account Session
## Delete Session

```http request
DELETE https://HOSTNAME/v1/account/sessions/{sessionId}
Expand All @@ -198,7 +198,7 @@ DELETE https://HOSTNAME/v1/account/sessions/{sessionId}
| --- | --- | --- | --- |
| sessionId | string | **Required** Session ID. Use the string 'current' to delete the current device session. | |

## Update Account Status
## Update Status

```http request
PATCH https://HOSTNAME/v1/account/status
Expand Down
10 changes: 5 additions & 5 deletions docs/databases.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ POST https://HOSTNAME/v1/databases

| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| databaseId | string | Unique Id. Choose your own unique ID or pass the string "unique()" to auto generate it. 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. | |
| databaseId | string | Unique Id. Choose your own unique ID or pass the string `ID.unique()` to auto generate it. 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. | |

## Get Database
Expand Down Expand Up @@ -58,7 +58,7 @@ PUT https://HOSTNAME/v1/databases/{databaseId}
| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| databaseId | string | **Required** Database ID. | |
| name | string | Collection name. Max length: 128 chars. | |
| name | string | Database name. Max length: 128 chars. | |

## Delete Database

Expand Down Expand Up @@ -103,7 +103,7 @@ POST https://HOSTNAME/v1/databases/{databaseId}/collections
| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| databaseId | string | **Required** Database ID. | |
| collectionId | string | Unique Id. Choose your own unique ID or pass the string "unique()" to auto generate it. 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. | |
| collectionId | string | Unique Id. Choose your own unique ID or pass the string `ID.unique()` to auto generate it. 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. | |
| 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). | |
Expand Down Expand Up @@ -384,7 +384,7 @@ DELETE https://HOSTNAME/v1/databases/{databaseId}/collections/{collectionId}/att
GET https://HOSTNAME/v1/databases/{databaseId}/collections/{collectionId}/documents
```

** Get a list of all the user's documents in a given collection. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of documents belonging to the provided collectionId. [Learn more about different API modes](/docs/admin). **
** Get a list of all the user's documents in a given collection. You can use the query params to filter your results. **

### Parameters

Expand All @@ -408,7 +408,7 @@ POST https://HOSTNAME/v1/databases/{databaseId}/collections/{collectionId}/docum
| --- | --- | --- | --- |
| 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). Make sure to define attributes before creating documents. | |
| documentId | string | Document ID. Choose your own unique ID or pass the string "unique()" to auto generate it. 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. | |
| documentId | string | Document ID. Choose your own unique ID or pass the string `ID.unique()` to auto generate it. 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. | |
| data | object | Document data as JSON object. | {} |
| permissions | array | An array of permissions strings. By default the current user is granted with all permissions. [Learn more about permissions](/docs/permissions). | |

Expand Down
16 changes: 0 additions & 16 deletions docs/examples/account/get-logs.md

This file was deleted.

16 changes: 0 additions & 16 deletions docs/examples/account/get-sessions.md

This file was deleted.

2 changes: 1 addition & 1 deletion docs/examples/account/update-phone.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ $client

$account = new Account($client);

$result = $account->updatePhone('', 'password');
$result = $account->updatePhone('+12065550100', 'password');
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ $client

$functions = new Functions($client);

$result = $functions->retryBuild('[FUNCTION_ID]', '[DEPLOYMENT_ID]', '[BUILD_ID]');
$result = $functions->createBuild('[FUNCTION_ID]', '[DEPLOYMENT_ID]', '[BUILD_ID]');
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

use Appwrite\Client;
use Appwrite\Services\Locale;
use Appwrite\Services\Graphql;

$client = new Client();

Expand All @@ -11,6 +11,6 @@ $client
->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
;

$locale = new Locale($client);
$graphql = new Graphql($client);

$result = $locale->getCurrencies();
$result = $graphql->mutation([]);
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

use Appwrite\Client;
use Appwrite\Services\Locale;
use Appwrite\Services\Graphql;

$client = new Client();

Expand All @@ -11,6 +11,6 @@ $client
->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
;

$locale = new Locale($client);
$graphql = new Graphql($client);

$result = $locale->getLanguages();
$result = $graphql->query([]);
16 changes: 0 additions & 16 deletions docs/examples/locale/get-continents.md

This file was deleted.

16 changes: 0 additions & 16 deletions docs/examples/locale/get-countries-e-u.md

This file was deleted.

16 changes: 0 additions & 16 deletions docs/examples/locale/get-countries-phones.md

This file was deleted.

16 changes: 0 additions & 16 deletions docs/examples/locale/get-countries.md

This file was deleted.

16 changes: 0 additions & 16 deletions docs/examples/teams/get-memberships.md

This file was deleted.

16 changes: 0 additions & 16 deletions docs/examples/users/get-logs.md

This file was deleted.

16 changes: 0 additions & 16 deletions docs/examples/users/get-memberships.md

This file was deleted.

Loading