Mod-Users BL

http://github.com/org/folio/mod-users-bl

Table of contents

Business Logic Users API

A front end for mod-users and mod-permissions

/bl-users

GET /bl-users

Get a number of user (and possibly related) records based on criteria in the user and related modules

GET /bl-users
Query Parameters
  • query: (string)

    A query expressed as a CQL string (see dev.folio.org/reference/glossary#cql) using valid searchable fields. The first example below shows the general form of a full CQL query, but those fields might not be relevant in this context.

    Example:

    (username=="ab*" or personal.firstName=="ab*" or personal.lastName=="ab*") and active=="true" sortby personal.lastName personal.firstName barcode
    
    active=true
    
  • offset: (integer - default: 0 - minimum: 0 - maximum: 2147483647)

    Skip over a number of elements by specifying an offset value for the query

    Example:

    0
  • limit: (integer - default: 10 - minimum: 0 - maximum: 2147483647)

    Limit the number of elements returned in the response

    Example:

    10
  • include: (array of string)

    indicates which referenced fields should be populated (de-referenced) by the service

Response 200

Body

Media type: application/json

Response 400

Bad request

Body

Media type: text/plain

Type: any

Example:

Bad request

Response 403

Access denied

Body

Media type: text/plain

Type: any

Example:

Access denied

Response 500

Internal server error

Body

Media type: text/plain

Type: any

Example:

Internal server error

GET /bl-users/by-id/{id}

Get a user by id

GET /bl-users/by-id/{id}
URI Parameters
  • id: required (string)
Query Parameters
  • include: (array of string)

    indicates which referenced fields should be populated (de-referenced) by the service

  • expandPermissions: (boolean - default: false)

    Whether or not to expand permissions listings

Response 200

Body

Media type: application/json

Response 400

Bad request

Body

Media type: text/plain

Type: any

Example:

Bad request

Response 403

Access denied

Body

Media type: text/plain

Type: any

Example:

Access denied

Response 404

User not found

Body

Media type: text/plain

Type: any

Example:

User not found

Response 422

Unprocessable Entity

Body

Media type: text/plain

Type: any

Example:

Bad request

Response 500

Internal server error

Body

Media type: text/plain

Type: any

Example:

Internal server error

GET /bl-users/by-username/{username}

Get a user by username

GET /bl-users/by-username/{username}
URI Parameters
  • username: required (string)
Query Parameters
  • include: (array of string)

    indicates which referenced fields should be populated (de-referenced) by the service

  • expandPermissions: (boolean - default: false)

    Whether or not to expand permissions listings

Response 200

Body

Media type: application/json

Response 400

Bad request

Body

Media type: text/plain

Type: any

Example:

Bad request

Response 403

Access denied

Body

Media type: text/plain

Type: any

Example:

Access denied

Response 404

User not found

Body

Media type: text/plain

Type: any

Example:

User not found

Response 422

Unprocessable Entity

Body

Media type: text/plain

Type: any

Example:

Bad request

Response 500

Internal server error

Body

Media type: text/plain

Type: any

Example:

Internal server error

GET /bl-users/_self

Get a user by self reference

GET /bl-users/_self
Query Parameters
  • include: (array of string)

    indicates which referenced fields should be populated (de-referenced) by the service

  • expandPermissions: (boolean - default: false)

    Whether or not to expand permissions listings

Response 200

Body

Media type: application/json

Response 400

Bad request

Body

Media type: text/plain

Type: any

Example:

Bad request

Response 403

Access denied

Body

Media type: text/plain

Type: any

Example:

Access denied

Response 404

User not found

Body

Media type: text/plain

Type: any

Example:

User not found

Response 422

Unprocessable Entity

Body

Media type: text/plain

Type: any

Example:

Bad request

Response 500

Internal server error

Body

Media type: text/plain

Type: any

Example:

Internal server error

POST /bl-users/login

Allow a new user to login and return an authtoken, along with a composite user record

POST /bl-users/login
Query Parameters
  • expandPermissions: (boolean - default: false)

    Whether or not to expand permissions listings

  • include: (array of string)

    indicates which referenced fields should be populated (de-referenced) by the service

Body

Media type: application/json

Response 201

Headers
  • x-okapi-token: required (string)
Body

Media type: application/json

Response 400

Bad request

Body

Media type: text/plain

Type: any

Example:

Bad request

Response 422

Unprocessable Entity

Body

Media type: text/plain

Type: any

Example:

Bad request

Response 500

Internal server error

Body

Media type: text/plain

Type: any

Example:

Internal server error

POST /bl-users/forgotten/password

called when a user has forgotten a password

POST /bl-users/forgotten/password
Body

Media type: application/json

Response 204

Response 400

Bad request

Body

Media type: text/plain

Type: any

Example:

Bad request

Response 500

Internal server error

Body

Media type: text/plain

Type: any

Example:

Internal server error

POST /bl-users/forgotten/username

called when a user has forgotten a username

POST /bl-users/forgotten/username
Body

Media type: application/json

Response 204

Response 400

Bad request

Body

Media type: text/plain

Type: any

Example:

Bad request

Response 500

Internal server error

Body

Media type: text/plain

Type: any

Example:

Internal server error

POST /bl-users/settings/myprofile/password

Allow change password for user

POST /bl-users/settings/myprofile/password
Body

Media type: application/json

Type: json

Content:

{
  "title": "Update Credentials Schema",
  "type": "object",
  "properties": {
    "username": {
      "type": "string"
    },
    "userId": {
      "type": "string"
    },
    "password": {
      "type": "string"
    },
    "newPassword" : {
      "type": "string"
    }
  }
}

Response 204

Successful update

Body

Media type: text/plain

Type: any

Response 400

Bad request

Body

Media type: application/json

Response 401

Unauthorized

Body

Media type: text/plain

Type: any

Example:

Unauthorized

Response 500

Internal server error

Body

Media type: text/plain

Type: any

Example:

Internal server error

POST /bl-users/password-reset/link

Generate and send password reset link

POST /bl-users/password-reset/link
Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "description": "Request to generate and send reset password link",
  "properties": {
    "userId": {
      "type": "string",
      "description": "Id of user to whom a reset password link is sent"
    }
  },
  "required": [
    "userId"
  ]
}

Response 200

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "description": "Response for reset password link generation",
  "properties": {
    "link": {
      "type": "string",
      "description": "Link for resetting password"
    }
  },
  "additionalProperties": false
}

POST /bl-users/password-reset/reset

Reset password

POST /bl-users/password-reset/reset
Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Password reset entity",
  "type": "object",
  "properties": {
    "resetPasswordActionId": {
      "description": "Password reset action identifier",
      "type": "string"
    },
    "newPassword": {
      "description": "New password",
      "type": "string"
    }
  },
  "additionalProperties": false,
  "required": [
    "resetPasswordActionId",
    "newPassword"
  ]
}

Response 204

Successful password reset

Response 422

Unprocessable Entity

Body

Media type: text/plain

Type: any

Example:

Bad request

Response 500

Internal server error

Body

Media type: text/plain

Type: any

Example:

Internal server error

POST /bl-users/password-reset/validate

POST /bl-users/password-reset/validate

Response 200

Successfully signed token

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Token response entity",
  "type": "object",
  "properties": {
    "resetPasswordActionId": {
      "description": "Password reset action identifier",
      "type": "string"
    },
    "token": {
      "description": "Access token",
      "type": "string"
    }
  },
  "additionalProperties": false,
  "required": [
    "resetPasswordActionId",
    "token"
  ]
}

Response 422

Unprocessable Entity

Body

Media type: text/plain

Type: any

Example:

Bad request

Response 500

Internal server error

Body

Media type: text/plain

Type: any

Example:

Internal server error