Developer Function: API: User Operation: Retrieve User (All)
## Overview
You can use the API to retrieve user records.
## Preparation
Please [Create an API Key](/manual/api-key) before performing API operations.
## Supported Versions
#### ApiGetMailAddresses
1. Pleasanter 1.3.16.0 or later
## Request
Send json data in the following request format:
|Setting item|Value|
|:--|:--|
|HTTP Method|POST|
|Content-Type |application/json|
|Character Code|UTF-8|
|URL|http://{server name}/api/users/get (*1)|
|Body|Refer to the json data below|
(*1) Please edit the {server name} part to suit your environment as appropriate.
For pleasanter.net, the format is as follows:
https\://pleasanter.net/fs/api/users/get
##### JSON
```
{
"ApiVersion": 1.1,
"ApiKey": "610saf33fg52D3Sas2f7g32...",
"View": {
"ApiGetMailAddresses": true
}
}
```
*ApiGetMailAddress is optional (not required). If omitted, false is specified. If true is specified, the response will include the email address in an array, as shown in the following example.
## Response
The following json data format will be returned. Please refer to [here](/manual/api-user) for the data layout (password cannot be obtained).
The following items will only be output when executed with the tenant administrator's API key.
|Output item|Display name on screen|
|:--|:--|
|LastLoginTime|Last login datetime|
|PasswordExpirationTime|Password expiration datetime|
|PasswordChangeTime|Password change datetime
|NumberOfLogins|Number of logins|
|NumberOfDenial|Number of failed logins|
|TenantManager|Tenant administrator|
|Disabled|Disabled|
|Lockout|Lock|
|LockoutCounter|Lock counter|
### (a) When executed with a tenant administrator's API key
##### JSON
```
{
"StatusCode": 200,
"Response": {
"Offset": 0,
"PageSize": 200,
"TotalCount": 1,
"Data": [
{
"TenantId": 12345,
"UserId": 12345,
"Ver": 1,
"LoginId": "hayato",
"GlobalId": "",
"Name": "Hayato Nakano",
"UserCode": "",
"Birthday": "2016-03-27T00:00:00",
"Gender": "",
"Language": "ja",
"TimeZone": "Tokyo Standard Time",
"DeptCode": "",
"DeptId": 0,
"Theme": "",
"Body": "",
"LastLoginTime": "2023-08-17T12:00:00",
"PasswordExpirationTime": "2023-08-31T12:00:00",
"PasswordChangeTime": "2023-06-02T12:00:00",
"NumberOfLogins": 100,
"NumberOfDenial": 5,
"TenantManager": false,
"Disabled": false,
"Lockout": false,
"LockoutCounter": 0,
"UserSettings": "{}",
"SecondaryAuthenticationCode": "",
"SecondaryAuthenticationCodeExpirationTime": "1899-12-30T00:00:00",
"LdapSearchRoot": "",
"SynchronizedTime": "1899-12-30T00:00:00",
"Comments": "[]",
"Creator": 2,
"Updator": 1,
"CreatedTime": "2023-04-01T12:00:00",
"UpdatedTime": "2023-08-15T12:00:00",
"MailAddresses": [
"webmaster@example.com",
"info@example.com"
],
"ApiVersion": 1.1,
"ClassHash": {
},
"NumHash": {
},
"DateHash": {
},
"DescriptionHash": {
},
"CheckHash": {
},
"AttachmentsHash": {
}
}
]
}
}
```
### (b) When executed with an API key other than that of the tenant administrator
##### JSON
```
{
"StatusCode": 200,
"Response": {
"Offset": 0,
"PageSize": 200,
"TotalCount": 1,
"Data": [
{
"TenantId": 12345,
"UserId": 12345,
"Ver": 1,
"LoginId": "hayato",
"GlobalId": "",
"Name": "Hayato Nakano",
"UserCode": "",
"Birthday": "2016-03-27T00:00:00",
"Gender": "",
"Language": "ja",
"TimeZone": "Tokyo Standard Time",
"DeptCode": "",
"DeptId": 0,
"Theme": "",
"Body": "",
"UserSettings": "{}",
"SecondaryAuthenticationCode": "",
"SecondaryAuthenticationCodeExpirationTime": "1899-12-30T00:00:00",
"LdapSearchRoot": "",
"SynchronizedTime": "1899-12-30T00:00:00",
"Comments": "[]",
"Creator": 2,
"Updator": 1,
"CreatedTime": "2023-04-01T12:00:00",
"UpdatedTime": "2023-08-15T12:00:00",
"MailAddresses": [
"webmaster@example.com",
"info@example.com"
],
"ApiVersion": 1.1,
"ClassHash": {
},
"NumHash": {
},
"DateHash": {
},
"DescriptionHash": {
},
"CheckHash": {
},
"AttachmentsHash": {
}
}
]
}
}
```
## Confirmation Items in Case of Error
[・Precautions when using the API and things to check if an error occurs](/manual/faq-api)
[・FAQ: What to check if modified configuration files or API requests (JSON format) are not recognized correctly](/manual/faq-json-format)
## Specification Changes
***API specifications have been partially changed since November 2018.**
- The URL format has been changed from '/pleasanter/api_items/xxxx' to '/pleasanter/api/items/xxxx'.
- The Content-Type specification has been changed from 'application/x-www-form-urlencoded' to 'application/json'.