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" or "MANAGER"
  • location, Mandatory. ID of a location
Example:
[
  {
    "type": "MANAGER",
    "location": 3245
  },
  {
    "type": "USER",
    "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
}
User Details
GET /users/ id

Get details of a user by user id, including user's roles as an array.

Request

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

Response

{
  "statusCode": 200,
  "id": 342,
  "email": "user@example.com",
  "firstName": "Mark",
  "lastName": "Dungey",
  "desk": 3,
  "roles": [
    {
      "id": 2364,
      "type": "CLERK",
      "location": 1265
    },
    {
      "id": 6532,
      "type": "MANAGER",
      "location": 3245
    }
  ]
}
Response field Type Description
id Number User ID
email String Email address
firstName String First name
lastName String Last name
desk Number Selected desk number
roles.id Number ID of a role
roles.type String User's role
roles.location Number The identifier of the location where given role is applicable. Not applicable to all roles
GET /users/ email

Get details of a user by email address (needs to be an exact match), including user's roles as an array.

Request

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

Response

{
  "statusCode": 200,
  "id": 342,
  "email": "user@example.com",
  "firstName": "Mark",
  "lastName": "Dungey",
  "desk": 3,
  "roles": [
    {
      "type": "CLERK",
      "location": 1265
    },
    {
      "type": "MANAGER",
      "location": 3245
    }
  ]
}
Response field Type Description
id Number User ID
email String Email address
firstName String First name
lastName String Last name
desk Number Selected desk number
roles.type String User's role
roles.location Number The identifier of the location where given role is applicable. Not applicable to all roles
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: SECRET_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: SECRET_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: SECRET_KEY"
          

Response

{
  "statusCode": 200
}