Helix Swarm Guide (2019.1)

Users : Basic API controller providing a simple version action

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. Beaware the fields are case sensitive for users. You can use one of the below: User, Type, Email, Update, 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

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 projects

To list all projects:

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:

{
    {
      "User": "bruno",
      "FullName": "Bruno First"
    },
    {
      "User": "super",
      "FullName": "Super Second"
    }
}

Unfollow all Users and Projects

Summary

Unfollow all Users and Projects

GET /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."
}