Creating a user
POST /users

Creates a new user.

Request

      curl -X POST https://api.qminder.com/v1/users
      -H "X-Qminder-REST-API-Key: KEY"
      
Request parameter Type Description
email String, Mandatory Unique valid email address
firstName String, Mandatory First name
lastName String, Mandatory Last name
roles JSON array, Mandatory Array of user roles. User has to have at least one role . All fields have following parameters:
  • type, Mandatory. "CLERK", "MANAGER" or "ADMIN"
  • location, Mandatory in case of "CLERK" or "MANAGER" types. ID of a location
Example:
[
  {
    "type": "MANAGER",
    "location": 3245
  },
  {
    "type": "CLERK",
    "location": 1265
  }
]

Response

{
  "statusCode": 200,
  "id": "226859"
}
Response field Type Description
id Number A unique ID of a created user
Adding a role
POST /users/ id /roles

Adds a new role for a existing user.

Request

      curl -X POST https://api.qminder.com/v1/users/3425/roles
      -d "type=MANAGER"
      -d "location=4255"
      -H "X-Qminder-REST-API-Key: KEY"
      
Request parameter Type Description
type String, Mandatory "CLERK", "MANAGER" or "ADMINISTRATOR"
location Number ID of a location. Mandatory when "type" is "CLERK" or "MANAGER". Has no effect when "type" is "ADMINISTRATOR".

Response

{
  "statusCode": 200
}
List of users
GET /locations/ id /users

Get list of users for specified location.

Request

  curl https://api.qminder.com/v1/locations/4052/users
  -H "X-Qminder-REST-API-Key: KEY"
          

Response

{
  "statusCode": 200,
  "data": [
    {...},
    {...}
  ]
} 
Returns a list of users which are wrapped in a data object.
User Details
GET /users/ id

Get details of a user by user id.

Request

      curl https://api.qminder.com/v1/users/342
      -H "X-Qminder-REST-API-Key: KEY"
      

Response

Returns a user.
GET /users/ email

Get details of a user by email address (needs to be an exact match).

Request

      curl https://api.qminder.com/v1/users/user@example.com
      -H "X-Qminder-REST-API-Key: KEY"
      

Response

Returns a user.
Deleting User
DELETE /users/ id

Deletes the user.

Request

      curl -X DELETE https://api.qminder.com/v1/users/458
      -H "X-Qminder-REST-API-Key: KEY"
      

Response

{
  "statusCode": 200
}
Selecting a location
POST /users/ id /location

Selects a location.

Request

      curl -X POST https://api.qminder.com/v1/users/3425/location \
      -d "location=6543" \
      -H "X-Qminder-REST-API-Key: KEY"
      
Request parameter Type Description
location Number ID of a location.

Response

{
  "statusCode": 200
}
Selecting a desk
POST /users/ id /desk

Selects a desk.

Request

      curl -X POST https://api.qminder.com/v1/users/3425/desk \
      -d "desk=12643" \
      -H "X-Qminder-REST-API-Key: KEY"
      
Request parameter Type Description
desk Number ID of a desk in users currently selected location.

Response

{
  "statusCode": 200
}
Clearing selected desk
DELETE /users/ id /desk

Removes users association with any desks.

Request

      curl -X DELETE https://api.qminder.com/v1/users/458/desk \
      -H "X-Qminder-REST-API-Key: KEY"
          

Response

{
  "statusCode": 200
}
Getting selected lines
GET /users/ id /lines

Returns lines selected by user in a selected location.

Request

      curl https://api.qminder.com/v1/users/458/lines \
      -H "X-Qminder-REST-API-Key: KEY"
          

Response

{
  "statusCode": 200,
  "selectedLines":[2342, 4245, 3214]
}
Selecting line
POST /users/ id /lines/ lineid

Selects line in currently selected location.

Request

      curl -X POST https://api.qminder.com/v1/users/458/lines/4245 \
      -H "X-Qminder-REST-API-Key: KEY"
          

Response

{
  "statusCode": 200
}
Deselecting line
DELETE /users/ id /lines/ lineid

Deselects line in currently selected location.

Request

      curl -X DELETE https://api.qminder.com/v1/users/458/lines/4245 \
      -H "X-Qminder-REST-API-Key: KEY"
          

Response

{
  "statusCode": 200
}
Adding profile picture to user
POST /users/ id /picture

Adds a profile picture to the user.

Request

            curl -X POST https://api.qminder.com/v1/users/458/picture
            -H "X-Qminder-REST-API-Key: KEY" -H "Content-Type: image/jpeg"
            --data-binary "@path_to_picture/picture.jpg"
          

Response

{
  "statusCode": 200
}
Deleting profile picture of user
DELETE /users/ id /picture

Deletes the profile picture of the user.

Request

            curl -X DELETE https://api.qminder.com/v1/users/458/picture
            -H "X-Qminder-REST-API-Key: KEY"
          

Response

{
  "statusCode": 200
}