Documentation

Overview

Table of Contents

Users in QReserve have a core user account that includes information about authentication, email, and name. Each user can be a member of one or more sites in QReserve that encases the user object in a SiteUser object where additional, site-specific information can be included such as role, account numbers, and custom site properties.

Typically an action performed in QReserve by a user is linked to a User object and from that a corresponding SiteUser object can be obtained for that user by finding the SiteUser object for a particular User and Site combination.

For convenience, adding users to your site can automatically handle the just-in-time creation of the core user account as well; however, a site administrator does not have the capability to delete a core user account but only to remove that account from their site. Site administrators can edit the name of users who are only members of sites they administer and they can edit emails of users who have not yet logged in.

Data Structures

These examples illustrate the data structures. The fields vary with the caller’s permissions and the endpoint’s query options.

SiteUser Object

{
  "site_user_id": "string",
  
  "user": {},                         // Core user object
  "active": boolean,
  
  "role": "user|moderator|administrator",
  
  "roles": {                          // Additional roles that can be provided to regular users
    "reservation_creator": boolean,   // Coming soon
    "reservation_editor": boolean
  },
  
  "account_numbers": [
    {
      "account_number": "string",
      "description": "string"
    },
    ...
  ],
  
  "actual_usage_identifiers": [
    {
      "identifier": "string",
      "description": "string"
    },
    ...
  ],
  
  "barcode": "string",
  "billing_address": "string",
  
  "exclude_from_activity_report": boolean,
  
  "hidden_note": "string",
  
  "ignore_min_max_times": boolean,
  "joinedsite": "string",             // Datetime
  "last_access": "string",            // Datetime
  
  "properties": [],                   // Array of Property objects
  "qrid": "string",
  
  "supervisor": {},                   // User object or null
  
  "approves": {                       // Things this user approves
    "reservables": [],                // Array of Reservable objects
    "users": []                       // Array of User objects
  },
  
  "approvers": [],                    // Array of User objects (people who approve this user)
  
  "cc_multiuse_token_available": boolean,  // If possible to add a payment method
  "cc_multiuse_token_exists": boolean,
  
  "training_records": [],             // Array of CredentialRecord objects
  
  "usergroups": [],                   // Array of UserGroup objects
  
  "can_edit_email": boolean,          // Edit capability flags for administrators
  "can_edit_name": boolean
}

User Object

{
  "user_id": "string",
  
  "is_admin_bot": boolean,            // Single automatically created admin account
  "is_user_bot": boolean,             // Standard test or bot accounts
  
  "affiliation": "string",
  "authenticatable": boolean,
  "description": "string",
  "display_name": "string",
  "email": "string",
  "expertise": "string",
  "givennames": "string",
  "image": "string",
  "image_is_default": boolean,
  "image_thumb": "string",
  "lastname": "string",
  "phone": "string",
  "site_role": "user|moderator|administrator",
  "twitter": "string",
  "unsubscribed": boolean,
  "verified": boolean,
  "website": "string"
}

UserGroup Object

{
  "name": "string",
  "color": "string",
  "reservation_visibility": boolean,
  "usergroup_id": integer
}

Endpoints