Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Panel

Table of Contents

Tip

The following URI prefixes are interchangeable:

  • /data
  • /data/archive
  • /REST

...

Note

These URIs are all still valid in XNAT 1.7, but are generally deprecated in favor of the XAPI-based User Management API


Panel

Table of Contents


Get All Users

Return a listing of all users in XNAT

Code Block
GET - /data/users

Parameters:

format
  • JSON (default)
  • XML
  • HTML
  • CSV

Response:

Code Block
{
    ResultSet: {
        Result: [
            {
                email: "string",
                firstname: "string",
                lastname: "string",
                login: "string",
                xnat_user_id: "integer"
            }
        ],
        title: "string",
        totalRecords: "integer" 
    }
}

...

Return details on a specific user in XNAT.

Code Block
GET - /data/usersuser/{ID | username | email`}

...

Code Block
{
    ResultSet: {
        Result: [
            {
                email: "string",
                enabled: "boolean",
                firstname: "string",
                lastname: "string",
                login: "string",
                xnat_user_id: "integer"userAuths: [
                    authId: "string",
                    method: "localdb"
                ],
                verified: "boolean"
            }
        ],
        title: "string",
        totalRecords: "integer" 
    }
}


Set A Favorite Project For User

Adds a project to the currently logged-in user's list of favorite projects. If a user has favorite projects specified, that list of projects will appear in a new navigation menu item in the top navigation under Browse > Favorite Projects.

Code Block
PUT - /data/users/favorites/Project/{project_id}

Parameters

{project_id}Required path parameter. Must be a valid XNAT project ID that the user has access to

Response: Returns an updated list of all favorite projects for this user

Code Block
{
  "ResultSet": {
    "Result": [
      {
        "datatype": "Project",
        "id": "Project_ID_1"
      },
      {
        "datatype": "Project",
        "id": "Project_ID_2"
      }
    ],
    "title": "User Favorites"
  }
}


Remove A Project From A User's List of Favorites

Code Block
DELETE - /data/users/favorites/Project/{project_id}

Parameters

{project_id}Required path parameter. Must be a valid XNAT project ID that the user has access to

Response

Code Block
{
  "ResultSet": {
    "Result": [
      {
        "datatype": "Project",
        "id": "Project_ID_1"
      }
    ],
    "title": "User Favorites"
  }
}