Users : Swarm Users
From Swarm 2022.2, Swarm no longer supports APIs older than v9.
Get List of Users
Summary
Get List of Users
GET /api/v9/users/
Description
Returns a list of users in Swarm.
Parameters
Parameter | Description | Type | Parameter Type | Required |
---|---|---|---|---|
fields |
An optional comma-separated list (or array) of fields to show for each user. Omitting this parameter or passing an empty value shows all fields. Be aware, the fields are case sensitive for users. You can use one of the following: User, Type, Email, Updated, Access, FullName, JobView, Password, AuthMethod, Reviews. |
string |
query |
No |
users |
An optional comma-separated list (or array) of users to display. Omitting this parameter or passing an empty value shows all users. |
string |
query |
No |
group |
An optional to get users from a group. Cannot be used with users parameter |
string |
query |
No |
ignoreExcludeList |
Determines if the list of users has the user_exclude_list filter applied or not. Add the parameter to ignore the user_exclude_list filter. |
boolean |
query |
No |
Example response
Successful Response:
HTTP/1.1 200 OK
{
"User": "bruno",
"Type": "standard",
"Email": "bruno@perforce.com",
"Updated": "2005/10/11 21:05:15",
"Access": "2018/04/12 14:55:10",
"FullName": "Bruno First",
"JobView": null,
"Password": null,
"AuthMethod": "perforce",
"Reviews": []
}
Example usage
Listing users
To list all users:
curl -u "username:password" "https://my-swarm-host/api/v9/users?fields=User,FullName&users=super,bruno"
Pagination is not currently supported by this endpoint. Swarm responds with a list of all users:
HTTP/1.1 200 OK
{
{
"User": "bruno",
"FullName": "Bruno First"
},
{
"User": "super",
"FullName": "Super Second"
}
}
Unfollow all Users and Projects
Summary
Unfollow all Users and Projects
POST /api/v9/users/{user}/unfollowall
Description
Admin and super users are permitted to execute unfollow all against any target user. Other users are only permitted to execute the call if they themselves are the target user
Example response
Successful Response:
HTTP/1.1 200 OK
{
"isValid": true,
"messages": "User {user} is no longer following any Projects or Users."
}