GET /api/users
List all users

GET /api/auth_source_ldaps/:auth_source_ldap_id/users
List all users for LDAP authentication source

GET /api/usergroups/:usergroup_id/users
List all users for user group

GET /api/roles/:role_id/users
List all users for role

GET /api/locations/:location_id/users
List all users for location

GET /api/organizations/:organization_id/users
List all users for organization

参数

参数名字 描述
auth_source_ldap_id
选填

ID of LDAP authentication source

Validations:

  • Must be String

usergroup_id
选填

ID of user group

Validations:

  • Must be String

role_id
选填

ID of role

Validations:

  • Must be String

location_id
选填

Scope by locations

Validations:

  • Must be Integer

organization_id
选填

Scope by organizations

Validations:

  • Must be Integer

search
选填

过滤结果

Validations:

  • Must be String

order
选填

结果排序

Validations:

  • Must be String

page
选填

页数

Validations:

  • Must be String

per_page
选填

每个请求中的条目数

Validations:

  • Must be String


GET /api/users/:id
Show a user

参数

参数名字 描述
id
必填

Validations:

  • Must be String


POST /api/users
Create a user

Adds role 'Default role' to the user by default

参数

参数名字 描述
user
必填

Validations:

  • Must be a Hash

user[login]
必填

Validations:

  • Must be String

user[firstname]
选填 , 允许空值

Validations:

  • Must be String

user[lastname]
选填 , 允许空值

Validations:

  • Must be String

user[mail]
必填

Validations:

  • Must be String

user[admin]
选填 , 允许空值

is an admin account

Validations:

  • Must be 'true' or 'false' or '1' or '0'

user[password]
必填

Validations:

  • Must be String

user[default_location_id]
选填 , 允许空值

Validations:

  • Must be Integer

user[default_organization_id]
选填 , 允许空值

Validations:

  • Must be Integer

user[auth_source_id]
必填

Validations:

  • Must be Integer

user[timezone]
选填 , 允许空值

User's timezone

Validations:

  • Must be one of: UTC, International Date Line West, Midway Island, American Samoa, Hawaii, Alaska, Pacific Time (US & Canada), Tijuana, Mountain Time (US & Canada), Arizona, Chihuahua, Mazatlan, Central Time (US & Canada), Saskatchewan, Guadalajara, Mexico City, Monterrey, Central America, Eastern Time (US & Canada), Indiana (East), Bogota, Lima, Quito, Atlantic Time (Canada), Caracas, La Paz, Santiago, Newfoundland, Brasilia, Buenos Aires, Montevideo, Georgetown, Greenland, Mid-Atlantic, Azores, Cape Verde Is., Dublin, Edinburgh, Lisbon, London, Casablanca, Monrovia, Belgrade, Bratislava, Budapest, Ljubljana, Prague, Sarajevo, Skopje, Warsaw, Zagreb, Brussels, Copenhagen, Madrid, Paris, Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna, West Central Africa, Bucharest, Cairo, Helsinki, Kyiv, Riga, Sofia, Tallinn, Vilnius, Athens, Istanbul, Minsk, Jerusalem, Harare, Pretoria, Kaliningrad, Moscow, St. Petersburg, Volgograd, Samara, Kuwait, Riyadh, Nairobi, Baghdad, Tehran, Abu Dhabi, Muscat, Baku, Tbilisi, Yerevan, Kabul, Ekaterinburg, Islamabad, Karachi, Tashkent, Chennai, Kolkata, Mumbai, New Delhi, Kathmandu, Astana, Dhaka, Sri Jayawardenepura, Almaty, Novosibirsk, Rangoon, Bangkok, Hanoi, Jakarta, Krasnoyarsk, Beijing, Chongqing, Hong Kong, Urumqi, Kuala Lumpur, Singapore, Taipei, Perth, Irkutsk, Ulaanbaatar, Seoul, Osaka, Sapporo, Tokyo, Yakutsk, Darwin, Adelaide, Canberra, Melbourne, Sydney, Brisbane, Hobart, Vladivostok, Guam, Port Moresby, Magadan, Srednekolymsk, Solomon Is., New Caledonia, Fiji, Kamchatka, Marshall Is., Auckland, Wellington, Nuku'alofa, Tokelau Is., Chatham Is., Samoa.

user[locale]
选填 , 允许空值

User's preferred locale

Validations:

  • Must be one of: zh_TW, zh_CN, sv_SE, ru, pt_BR, ko, ja, it, gl, fr, es, en_GB, en, de, ca.

user[location_ids]
选填 , 允许空值

REPLACE locations with given ids

Validations:

  • Must be an array of any type

user[organization_ids]
选填 , 允许空值

REPLACE organizations with given ids.

Validations:

  • Must be an array of any type


PUT /api/users/:id
Update a user

Adds role 'Default role' to the user if it is not already present. Only another admin can change the admin account attribute.

参数

参数名字 描述
id
必填

Validations:

  • Must be String

user
必填

Validations:

  • Must be a Hash

user[login]
选填

Validations:

  • Must be String

user[firstname]
选填 , 允许空值

Validations:

  • Must be String

user[lastname]
选填 , 允许空值

Validations:

  • Must be String

user[mail]
选填

Validations:

  • Must be String

user[admin]
选填 , 允许空值

is an admin account

Validations:

  • Must be 'true' or 'false' or '1' or '0'

user[password]
选填

Validations:

  • Must be String

user[default_location_id]
选填 , 允许空值

Validations:

  • Must be Integer

user[default_organization_id]
选填 , 允许空值

Validations:

  • Must be Integer

user[auth_source_id]
选填

Validations:

  • Must be Integer

user[timezone]
选填 , 允许空值

User's timezone

Validations:

  • Must be one of: UTC, International Date Line West, Midway Island, American Samoa, Hawaii, Alaska, Pacific Time (US & Canada), Tijuana, Mountain Time (US & Canada), Arizona, Chihuahua, Mazatlan, Central Time (US & Canada), Saskatchewan, Guadalajara, Mexico City, Monterrey, Central America, Eastern Time (US & Canada), Indiana (East), Bogota, Lima, Quito, Atlantic Time (Canada), Caracas, La Paz, Santiago, Newfoundland, Brasilia, Buenos Aires, Montevideo, Georgetown, Greenland, Mid-Atlantic, Azores, Cape Verde Is., Dublin, Edinburgh, Lisbon, London, Casablanca, Monrovia, Belgrade, Bratislava, Budapest, Ljubljana, Prague, Sarajevo, Skopje, Warsaw, Zagreb, Brussels, Copenhagen, Madrid, Paris, Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna, West Central Africa, Bucharest, Cairo, Helsinki, Kyiv, Riga, Sofia, Tallinn, Vilnius, Athens, Istanbul, Minsk, Jerusalem, Harare, Pretoria, Kaliningrad, Moscow, St. Petersburg, Volgograd, Samara, Kuwait, Riyadh, Nairobi, Baghdad, Tehran, Abu Dhabi, Muscat, Baku, Tbilisi, Yerevan, Kabul, Ekaterinburg, Islamabad, Karachi, Tashkent, Chennai, Kolkata, Mumbai, New Delhi, Kathmandu, Astana, Dhaka, Sri Jayawardenepura, Almaty, Novosibirsk, Rangoon, Bangkok, Hanoi, Jakarta, Krasnoyarsk, Beijing, Chongqing, Hong Kong, Urumqi, Kuala Lumpur, Singapore, Taipei, Perth, Irkutsk, Ulaanbaatar, Seoul, Osaka, Sapporo, Tokyo, Yakutsk, Darwin, Adelaide, Canberra, Melbourne, Sydney, Brisbane, Hobart, Vladivostok, Guam, Port Moresby, Magadan, Srednekolymsk, Solomon Is., New Caledonia, Fiji, Kamchatka, Marshall Is., Auckland, Wellington, Nuku'alofa, Tokelau Is., Chatham Is., Samoa.

user[locale]
选填 , 允许空值

User's preferred locale

Validations:

  • Must be one of: zh_TW, zh_CN, sv_SE, ru, pt_BR, ko, ja, it, gl, fr, es, en_GB, en, de, ca.

user[location_ids]
选填 , 允许空值

REPLACE locations with given ids

Validations:

  • Must be an array of any type

user[organization_ids]
选填 , 允许空值

REPLACE organizations with given ids.

Validations:

  • Must be an array of any type


DELETE /api/users/:id
Delete a user

参数

参数名字 描述
id
必填

Validations:

  • Must be String