1
0
Fork 0
mirror of synced 2024-07-07 07:25:56 +12:00
appwrite/app/sdks/server-php/docs/users.md

151 lines
3.4 KiB
Markdown
Raw Normal View History

2019-05-09 18:54:39 +12:00
# Users Service
## List Users
```http request
2019-10-09 17:16:38 +13:00
GET https://appwrite.io/v1/users
2019-05-09 18:54:39 +12:00
```
2019-10-09 21:40:02 +13:00
** Get a list of all the project users. You can use the query params to filter your results. **
2019-05-09 18:54:39 +12:00
### Parameters
| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| search | string | Search term to filter your list results. | |
| limit | integer | Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request. | 25 |
| offset | integer | Results offset. The default value is 0. Use this param to manage pagination. | 0 |
| orderType | string | Order result by ASC or DESC order. | ASC |
## Create User
```http request
2019-10-09 17:16:38 +13:00
POST https://appwrite.io/v1/users
2019-05-09 18:54:39 +12:00
```
2019-10-09 21:40:02 +13:00
** Create a new user. **
2019-05-09 18:54:39 +12:00
### Parameters
| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
2020-02-14 19:28:54 +13:00
| email | string | User email. | |
| password | string | User password. | |
| name | string | User name. | |
2019-05-09 18:54:39 +12:00
## Get User
```http request
2019-10-09 17:16:38 +13:00
GET https://appwrite.io/v1/users/{userId}
2019-05-09 18:54:39 +12:00
```
2019-10-09 21:40:02 +13:00
** Get user by its unique ID. **
2019-05-09 18:54:39 +12:00
### Parameters
| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| userId | string | **Required** User unique ID. | |
## Get User Logs
```http request
2019-10-09 17:16:38 +13:00
GET https://appwrite.io/v1/users/{userId}/logs
2019-05-09 18:54:39 +12:00
```
2019-10-09 21:40:02 +13:00
** Get user activity logs list by its unique ID. **
2019-05-09 18:54:39 +12:00
### Parameters
| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| userId | string | **Required** User unique ID. | |
2020-01-28 10:50:41 +13:00
## Get User Preferences
2019-05-09 18:54:39 +12:00
```http request
2019-10-09 17:16:38 +13:00
GET https://appwrite.io/v1/users/{userId}/prefs
2019-05-09 18:54:39 +12:00
```
2019-10-09 21:40:02 +13:00
** Get user preferences by its unique ID. **
2019-05-09 18:54:39 +12:00
### Parameters
| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| userId | string | **Required** User unique ID. | |
2020-01-28 10:50:41 +13:00
## Update User Preferences
2019-10-09 17:16:38 +13:00
```http request
PATCH https://appwrite.io/v1/users/{userId}/prefs
```
2019-10-09 21:40:02 +13:00
** Update user preferences by its unique ID. You can pass only the specific settings you wish to update. **
2019-10-09 17:16:38 +13:00
### Parameters
| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| userId | string | **Required** User unique ID. | |
2020-02-14 19:28:54 +13:00
| prefs | object | Prefs key-value JSON object. | |
2019-10-09 17:16:38 +13:00
2019-05-09 18:54:39 +12:00
## Get User Sessions
```http request
2019-10-09 17:16:38 +13:00
GET https://appwrite.io/v1/users/{userId}/sessions
2019-05-09 18:54:39 +12:00
```
2019-10-09 21:40:02 +13:00
** Get user sessions list by its unique ID. **
2019-05-09 18:54:39 +12:00
### Parameters
| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| userId | string | **Required** User unique ID. | |
## Delete User Sessions
```http request
2019-10-09 17:16:38 +13:00
DELETE https://appwrite.io/v1/users/{userId}/sessions
2019-05-09 18:54:39 +12:00
```
** Delete all user sessions by its unique ID. **
### Parameters
| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| userId | string | **Required** User unique ID. | |
## Delete User Session
```http request
2020-05-02 16:23:56 +12:00
DELETE https://appwrite.io/v1/users/{userId}/sessions/{sessionId}
2019-05-09 18:54:39 +12:00
```
2019-10-09 21:40:02 +13:00
** Delete user sessions by its unique ID. **
2019-05-09 18:54:39 +12:00
### Parameters
| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| userId | string | **Required** User unique ID. | |
2020-05-02 16:23:56 +12:00
| sessionId | string | **Required** User unique session ID. | |
2019-05-09 18:54:39 +12:00
2019-10-14 09:19:06 +13:00
## Update User Status
2019-05-09 18:54:39 +12:00
```http request
2019-10-09 17:16:38 +13:00
PATCH https://appwrite.io/v1/users/{userId}/status
2019-05-09 18:54:39 +12:00
```
2019-10-09 21:40:02 +13:00
** Update user status by its unique ID. **
2019-05-09 18:54:39 +12:00
### Parameters
| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| userId | string | **Required** User unique ID. | |
2019-10-22 06:15:27 +13:00
| status | string | User Status code. To activate the user pass 1, to block the user pass 2 and for disabling the user pass 0 | |
2019-05-09 18:54:39 +12:00