Set a user's roles - Fluid Topics - Latest

Fluid Topics API Reference Guide

Category
Reference Guides
Audience
public
Version
Latest

This web service modifies the roles that an administrator has manually assigned to a user.

This web service does not update user roles originating from a pre-authentication script.

This web service is only available to users with the ADMIN role.

Method Endpoint
PUT /api/users/{userId}/roles
Path parameter Type Description
{userId} String The user's identifier.

Request example

The following lines show an example of a JSON request body:

{
    "manualRoles": ["ADMIN"]
}
Field Type Required? Description
manualRoles Array Yes One or more roles to manually assign to the user. Accepted values are PERSONAL_BOOK_USER, PERSONAL_BOOK_SHARE_USER, HTML_EXPORT_USER, PDF_EXPORT_USER, SAVED_SEARCH_USER, COLLECTION_USER, OFFLINE_USER, ANALYTICS_USER, BETA_USER, DEBUG_USER, PRINT_USER, RATING_USER, FEEDBACK_USER, KHUB_ADMIN, CONTENT_PUBLISHER, USERS_ADMIN, PORTAL_ADMIN, and ADMIN.
Return code Description
200 OK The request is valid and data is returned.
400 BAD REQUEST A parameter is missing or a role does not exist.
401 UNAUTHORIZED The authorization header is absent or invalid.
403 FORBIDDEN The user or API key does not have the ADMIN or USERS_ADMIN role.
404 NOT FOUND No user exists with this ID.

For a comprehensive list of all possible return codes, see Return codes.

Response body

The following lines show an example of a JSON response body:

{
    "id": "a43eb18a-3f48-4732-9389-61b540ce9d0d",
    "manualRoles": ["ADMIN"],
    "authenticationRoles": [],
    "defaultRoles": []
}
Field Type Description
id String The user's identifier.
manualRoles Array The groups an administrator manually assigned to the user.
authenticationRoles Array The user groups provided by the post authentication script.
defaultRoles Array The default roles configured for the portal.