You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**This SDK is compatible with Appwrite server version 0.7.0. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-php/releases).**
5
7
6
8
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.
7
9
Use the PHP SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools.
8
10
For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)
Copy file name to clipboardExpand all lines: composer.json
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,11 @@
1
1
{
2
2
"name": "appwrite/appwrite",
3
-
"description": "Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks",
3
+
"description": "Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API",
Copy file name to clipboardExpand all lines: docs/avatars.md
+25-4Lines changed: 25 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,13 +23,13 @@ GET https://appwrite.io/v1/avatars/browsers/{code}
23
23
GET https://appwrite.io/v1/avatars/credit-cards/{code}
24
24
```
25
25
26
-
**Need to display your users with your billing method or their payment methods? The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings. **
26
+
** The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings. **
| width | integer | Image width. Pass an integer between 0 to 2000. Defaults to 100. | 100 |
34
34
| height | integer | Image height. Pass an integer between 0 to 2000. Defaults to 100. | 100 |
35
35
| quality | integer | Image quality. Pass an integer between 0 to 100. Defaults to 100. | 100 |
@@ -40,7 +40,8 @@ GET https://appwrite.io/v1/avatars/credit-cards/{code}
40
40
GET https://appwrite.io/v1/avatars/favicon
41
41
```
42
42
43
-
** Use this endpoint to fetch the favorite icon (AKA favicon) of a any remote website URL. **
43
+
** Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.
44
+
**
44
45
45
46
### Parameters
46
47
@@ -81,6 +82,26 @@ GET https://appwrite.io/v1/avatars/image
81
82
| width | integer | Resize preview image width, Pass an integer between 0 to 2000. | 400 |
82
83
| height | integer | Resize preview image height, Pass an integer between 0 to 2000. | 400 |
83
84
85
+
## Get User Initials
86
+
87
+
```http request
88
+
GET https://appwrite.io/v1/avatars/initials
89
+
```
90
+
91
+
** Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned.
92
+
93
+
You can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials. **
94
+
95
+
### Parameters
96
+
97
+
| Field Name | Type | Description | Default |
98
+
| --- | --- | --- | --- |
99
+
| name | string | Full Name. When empty, current user name or email will be used. Max length: 128 chars. ||
100
+
| width | integer | Image width. Pass an integer between 0 to 2000. Defaults to 100. | 500 |
101
+
| height | integer | Image height. Pass an integer between 0 to 2000. Defaults to 100. | 500 |
102
+
| color | string | Changes text color. By default a random color will be picked and stay will persistent to the given name. ||
103
+
| background | string | Changes background color. By default a random color will be picked and stay will persistent to the given name. ||
104
+
84
105
## Get QR Code
85
106
86
107
```http request
@@ -96,5 +117,5 @@ GET https://appwrite.io/v1/avatars/qr
96
117
| text | string |**Required** Plain text to be converted to QR code image. ||
97
118
| size | integer | QR code size. Pass an integer between 0 to 1000. Defaults to 400. | 400 |
98
119
| margin | integer | Margin from edge. Pass an integer between 0 to 10. Defaults to 1. | 1 |
99
-
| download |integer| Return resulting image with 'Content-Disposition: attachment ' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0. |0|
120
+
| download |boolean| Return resulting image with 'Content-Disposition: attachment ' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0. ||
Copy file name to clipboardExpand all lines: docs/database.md
+21-33Lines changed: 21 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,13 +6,13 @@
6
6
GET https://appwrite.io/v1/database/collections
7
7
```
8
8
9
-
** Get a list of all the user collections. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project collections. [Learn more about different API modes](/docs/admin). **
9
+
** Get a list of all the user collections. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project's collections. [Learn more about different API modes](/docs/admin). **
10
10
11
11
### Parameters
12
12
13
13
| Field Name | Type | Description | Default |
14
14
| --- | --- | --- | --- |
15
-
| search | string | Search term to filter your list results. ||
15
+
| search | string | Search term to filter your list results. Max length: 256 chars. ||
16
16
| limit | integer | Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request. | 25 |
17
17
| offset | integer | Results offset. The default value is 0. Use this param to manage pagination. | 0 |
18
18
| orderType | string | Order result by ASC or DESC order. | ASC |
@@ -29,7 +29,7 @@ POST https://appwrite.io/v1/database/collections
29
29
30
30
| Field Name | Type | Description | Default |
31
31
| --- | --- | --- | --- |
32
-
| name | string | Collection name. ||
32
+
| name | string | Collection name. Max length: 128 chars. ||
33
33
| read | array | An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. ||
34
34
| write | array | An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. ||
35
35
| rules | array | Array of [rule objects](/docs/rules). Each rule define a collection field name, data type and validation. ||
@@ -40,7 +40,7 @@ POST https://appwrite.io/v1/database/collections
40
40
GET https://appwrite.io/v1/database/collections/{collectionId}
41
41
```
42
42
43
-
** Get collection by its unique ID. This endpoint response returns a JSON object with the collection metadata. **
43
+
** Get a collection by its unique ID. This endpoint response returns a JSON object with the collection metadata. **
44
44
45
45
### Parameters
46
46
@@ -54,14 +54,14 @@ GET https://appwrite.io/v1/database/collections/{collectionId}
54
54
PUT https://appwrite.io/v1/database/collections/{collectionId}
| name | string | Collection name. Max length: 128 chars. ||
65
65
| read | array | An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions(/docs/permissions) and get a full list of available permissions. ||
66
66
| write | array | An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. ||
67
67
| rules | array | Array of [rule objects](/docs/rules). Each rule define a collection field name, data type and validation. |[]|
GET https://appwrite.io/v1/database/collections/{collectionId}/documents
87
87
```
88
88
89
-
** Get a list of all the user documents. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project documents. [Learn more about different API modes](/docs/admin). **
89
+
** Get a list of all the user documents. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project's documents. [Learn more about different API modes](/docs/admin). **
90
90
91
91
### Parameters
92
92
93
93
| Field Name | Type | Description | Default |
94
94
| --- | --- | --- | --- |
95
-
| collectionId | string |**Required** Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/database?platform=server#createCollection). ||
95
+
| collectionId | string |**Required** Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/server/database#createCollection). ||
96
96
| filters | array | Array of filter strings. Each filter is constructed from a key name, comparison operator (=, !=, >, <, <=, >=) and a value. You can also use a dot (.) separator in attribute names to filter by child document attributes. Examples: 'name=John Doe' or 'category.$id>=5bed2d152c362'. |[]|
97
-
|offset| integer |Offset value. Use this value to manage pagination. | 0|
98
-
|limit| integer |Maximum number of documents to return in response. Use this value to manage pagination. |50|
99
-
| orderField | string | Document field that results will be sorted by. |$id|
97
+
|limit| integer |Maximum number of documents to return in response. Use this value to manage pagination. By default will return maximum 25 results. Maximum of 100 results allowed per request. | 25|
98
+
|offset| integer |Offset value. The default value is 0. Use this param to manage pagination. |0|
99
+
| orderField | string | Document field that results will be sorted by. ||
100
100
| orderType | string | Order direction. Possible values are DESC for descending order, or ASC for ascending order. | ASC |
101
101
| orderCast | string | Order field type casting. Possible values are int, string, date, time or datetime. The database will attempt to cast the order field to the value you pass here. The default value is a string. | string |
102
-
| search | string | Search query. Enter any free text search. The database will try to find a match against all document attributes and children. ||
103
-
| first | integer | Return only the first document. Pass 1 for true or 0 for false. The default value is 0. | 0 |
104
-
| last | integer | Return only the last document. Pass 1 for true or 0 for false. The default value is 0. | 0 |
102
+
| search | string | Search query. Enter any free text search. The database will try to find a match against all document attributes and children. Max length: 256 chars. ||
105
103
106
104
## Create Document
107
105
108
106
```http request
109
107
POST https://appwrite.io/v1/database/collections/{collectionId}/documents
110
108
```
111
109
112
-
** Create a new Document. **
110
+
** Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](/docs/server/database#databaseCreateCollection) API or directly from your database console. **
113
111
114
112
### Parameters
115
113
116
114
| Field Name | Type | Description | Default |
117
115
| --- | --- | --- | --- |
118
-
| collectionId | string |**Required** Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/database?platform=server#createCollection). ||
116
+
| collectionId | string |**Required** Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/server/database#createCollection). ||
119
117
| data | object | Document data as JSON object. ||
120
118
| read | array | An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. ||
121
119
| write | array | An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. ||
@@ -129,13 +127,13 @@ POST https://appwrite.io/v1/database/collections/{collectionId}/documents
129
127
GET https://appwrite.io/v1/database/collections/{collectionId}/documents/{documentId}
130
128
```
131
129
132
-
** Get document by its unique ID. This endpoint response returns a JSON object with the document data. **
130
+
** Get a document by its unique ID. This endpoint response returns a JSON object with the document data. **
133
131
134
132
### Parameters
135
133
136
134
| Field Name | Type | Description | Default |
137
135
| --- | --- | --- | --- |
138
-
| collectionId | string |**Required** Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/database?platform=server#createCollection). ||
136
+
| collectionId | string |**Required** Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/server/database#createCollection). ||
** Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated. **
146
+
147
147
### Parameters
148
148
149
149
| Field Name | Type | Description | Default |
150
150
| --- | --- | --- | --- |
151
-
| collectionId | string |**Required** Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/database?platform=server#createCollection). ||
151
+
| collectionId | string |**Required** Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/server/database#createCollection). ||
| data | object | Document data as JSON object. ||
154
154
| read | array | An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. ||
** Delete document by its unique ID. This endpoint deletes only the parent documents, his attributes and relations to other documents. Child documents **will not** be deleted. **
163
+
** Delete a document by its unique ID. This endpoint deletes only the parent documents, its attributes and relations to other documents. Child documents **will not** be deleted. **
164
164
165
165
### Parameters
166
166
167
167
| Field Name | Type | Description | Default |
168
168
| --- | --- | --- | --- |
169
-
| collectionId | string |**Required** Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/database?platform=server#createCollection). ||
169
+
| collectionId | string |**Required** Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/server/database#createCollection). ||
0 commit comments