# Application Users Controller Resource

The API allows you to list, view, edit and create application users.

### GET /users

Return list of users.

Request Parameters
name | type | description | constraints
--- | --- | --- | ---
active | query |  | boolean
direction | query |  |
filter | query |  |
groups | query |  |
nameLike | query |  |
orderBy | query |  |
page | query |  |
size | query |  |

Response Body
media type | data type | description
--- | --- | ---
application/json | array of AppUserListRecord (JSON) | list of users

#### Example

##### Request

    GET /users
    Content-Type: */*
    Accept: application/json

    ...

##### Response

    HTTP/1.1 200 OK
    Content-Type: application/json

    [ {
      "guid" : "f8f73bf9-2445-4bce-a7dd-753be3b40a67"
    } ]

### POST /users

Create a new user.

Request Body
media type | data type | description
--- | --- | ---
application/json | NewUserRequest (JSON) | specify data for new user

Response Body
media type | data type | description
--- | --- | ---
application/json | AppUserDetails (JSON) | details of newly created user

#### Example

##### Request

    POST /users
    Content-Type: application/json
    Accept: application/json

    {
      "uiTimeZone" : "UTC"
    }

##### Response

    HTTP/1.1 201 Created
    Content-Type: application/json

    {
      "guid" : "f8f73bf9-2445-4bce-a7dd-753be3b40a67",
      "lastSuccessfulLogin" : 1451649601000,
      "lastFailedLogin" : 1451677502000,
      "uiTimeZone" : "UTC"
    }

### PUT /users/active

Change active state for specified list of users.

Request Body
media type | data type | description
--- | --- | ---
application/json | SingleAttributeBatchUpdate (JSON) | specify active state and guids of users

Response Body
media type | data type | description
--- | --- | ---
application/json | BatchResponse (JSON) | list of successful and unsuccessful updates of active state

#### Example

##### Request

    PUT /users/active
    Content-Type: application/json
    Accept: application/json

    { }

##### Response

    HTTP/1.1 204 No Content
    Content-Type: application/json

    { }

### POST /users/delete

Request Body
media type | data type
--- | ---
application/json | DeleteAppUsersRequest (JSON)

#### Example

##### Request

    POST /users/delete
    Content-Type: application/json

    { }

##### Response

    HTTP/1.1 201 Created

### GET /users/me

Response Body
media type | data type | description
--- | --- | ---
application/json | CurrentUserBasicInfo (JSON) |

#### Example

##### Request

    GET /users/me
    Content-Type: application/json
    Accept: application/json

    ...

##### Response

    HTTP/1.1 200 OK
    Content-Type: application/json

    { }

### PUT /users/me

Request Body
media type | data type
--- | ---
application/json | UpdatedUserSettings (JSON)

Response Body
media type | data type | description
--- | --- | ---
application/json | AppUserDetails (JSON) |

#### Example

##### Request

    PUT /users/me
    Content-Type: application/json
    Accept: application/json

    {
      "uiTimeZone" : "UTC"
    }

##### Response

    HTTP/1.1 204 No Content
    Content-Type: application/json

    {
      "guid" : "f8f73bf9-2445-4bce-a7dd-753be3b40a67",
      "lastSuccessfulLogin" : 1451649601000,
      "lastFailedLogin" : 1451677502000,
      "uiTimeZone" : "UTC"
    }

### GET /users/third-party-restrictions

Return list of all possible third party restrictions.

Response Body
media type | data type | description
--- | --- | ---
application/json | array of ThirdPartyRestriction (JSON) | list of all possible third party restrictions

#### Example

##### Request

    GET /users/third-party-restrictions
    Content-Type: */*
    Accept: application/json

    ...

##### Response

    HTTP/1.1 200 OK
    Content-Type: application/json

    "NO_RESTRICTION"

### DELETE /users/{guid}

Remove user.

Request Parameters
name | type | description
--- | --- | ---
guid | path | specify local unique identifier for user (use by vProtect)

#### Example

##### Request

    DELETE /users/{guid}
    Content-Type: */*

    ...

##### Response

    HTTP/1.1 204 No Content

### GET /users/{guid}

Get a single user.

Request Parameters
name | type | description
--- | --- | ---
guid | path | specify local unique identifier for user (use by vProtect)

Response Body
media type | data type | description
--- | --- | ---
application/json | AppUserDetails (JSON) | a single user details

#### Example

##### Request

    GET /users/{guid}
    Content-Type: */*
    Accept: application/json

    ...

##### Response

    HTTP/1.1 200 OK
    Content-Type: application/json

    {
      "guid" : "f8f73bf9-2445-4bce-a7dd-753be3b40a67",
      "lastSuccessfulLogin" : 1451649601000,
      "lastFailedLogin" : 1451677502000,
      "uiTimeZone" : "UTC"
    }

### PUT /users/{guid}

Change user details.

Request Parameters
name | type | description
--- | --- | ---
guid | path | specify local unique identifier for user (use by vProtect)

Request Body
media type | data type | description
--- | --- | ---
application/json | UpdateUserRequest (JSON) | specify user details to update

Response Body
media type | data type | description
--- | --- | ---
application/json | AppUserDetails (JSON) | updated details of user

#### Example

##### Request

    PUT /users/{guid}
    Content-Type: application/json
    Accept: application/json

    {
      "uiTimeZone" : "UTC"
    }

##### Response

    HTTP/1.1 204 No Content
    Content-Type: application/json

    {
      "guid" : "f8f73bf9-2445-4bce-a7dd-753be3b40a67",
      "lastSuccessfulLogin" : 1451649601000,
      "lastFailedLogin" : 1451677502000,
      "uiTimeZone" : "UTC"
    }

### PUT /users/me/password

Request Body
media type | data type
--- | ---
application/json | StringDTO (JSON)

#### Example

##### Request

    PUT /users/me/password
    Content-Type: application/json

    { }

##### Response

    HTTP/1.1 204 No Content

### GET /users/{guid}/groups

Get a list of user groups.

Request Parameters
name | type | description
--- | --- | ---
guid | path | specify local unique identifier for user (use by vProtect)

Response Body
media type | data type | description
--- | --- | ---
application/json | array of AppUserGroupListRecordDto (JSON) | a single user details

#### Example

##### Request

    GET /users/{guid}/groups
    Content-Type: */*
    Accept: application/json

    ...

##### Response

    HTTP/1.1 200 OK
    Content-Type: application/json

    [ { } ]

### PUT /users/{guid}/info-tour

Set user info tour enablement

Request Parameters
name | type | description
--- | --- | ---
guid | path | local unique identifier for user (use by vProtect)

Request Body
media type | data type | description
--- | --- | ---
application/json | BooleanDTO (JSON) | info tour enabled value

#### Example

##### Request

    PUT /users/{guid}/info-tour
    Content-Type: application/json

    { }

##### Response

    HTTP/1.1 204 No Content

### PUT /users/{guid}/password

Change user password.

Request Parameters
name | type | description
--- | --- | ---
guid | path | specify local unique identifier for user (use by vProtect)

Request Body
media type | data type | description
--- | --- | ---
application/json | StringDTO (JSON) | specify user password

#### Example

##### Request

    PUT /users/{guid}/password
    Content-Type: application/json

    { }

##### Response

    HTTP/1.1 204 No Content

### GET /users/{guid}/settings

Get user personal settings

Request Parameters
name | type | description
--- | --- | ---
guid | path | local unique identifier for user (use by vProtect)

Response Body
media type | data type | description
--- | --- | ---
application/json | AppUserSettingsDetails (JSON) |

#### Example

##### Request

    GET /users/{guid}/settings
    Content-Type: application/json
    Accept: application/json

    ...

##### Response

    HTTP/1.1 200 OK
    Content-Type: application/json

    { }

### PUT /users/{guid}/settings

Set user personal settings

Request Parameters
name | type | description
--- | --- | ---
guid | path | local unique identifier for user (use by vProtect)

Request Body
media type | data type | description
--- | --- | ---
application/json | AppUserSettingsRequest (JSON) | user settings request

Response Body
media type | data type | description
--- | --- | ---
application/json | AppUserSettingsDetails (JSON) |

#### Example

##### Request

    PUT /users/{guid}/settings
    Content-Type: application/json
    Accept: application/json

    { }

##### Response

    HTTP/1.1 204 No Content
    Content-Type: application/json

    { }