Back to API overview

Person

Internal use only.

List

Definition

GET https://api-v2.swissunihockey.ch/bo/people/

List people, their roles and the roles' attributes.

You need people_reader rights in order to use this.

You may request multiple people by their id (aka PNr) using the parameters

ids
comma-separated list of user ids

or filter the returned people by date of last modification using

changed_since
Required. Date in ISO-compatible format (e.g. 2016-12-23).
People with changes that happened since the beginning of the given day will be returned.
changed_until
Optional. Date in ISO-compatible format (e.g. 2016-12-24).
People with changes that happened no later than the given day will be returned.

Various representations are available:

set
minimal or with_roles

Fetching role info

If you provide set=with_roles, the roles array will contain references to the different roles a person exercises. Depending on the type of the role, the provided details change.

All roles share a bo_role_status, one of the following values:

   
Value Status name in german
active aktiv
inactive inaktiv
demissioned zurückgetreten
dispensed dispensiert
deleted gelöscht
suspended suspendiert
announced_demission Rücktritt angekündigt
announced_dispensation Dispensation angekündigt

An example

Sample response:


{
  "list": [
    {
      "attrs": {
        "roles": [
          "players/7295"
        ],
        "addresses": [
          "addresses/7295"
        ],
        "first_name": "Max",
        "last_name": "Muster",
        "email": "max.muster@muster.example",
        "email_2": null,
        "language": "de",
        "phone_mobile": "0791234567",
        "phone_private": "0311234567",
        "phone_business": null,
        "phone_business_headquarters": null,
        "phone_contact": null,
        "website": null,
        "name_contact": null,
        "birth_date": "1990-01-01"
      },
      "set": "with_roles",
      "type": "Person",
      "id": 7295
    }
  ],
  "references": {
    "players/7295": {
      "attrs": {
        "identification": "SP7295",
        "bo_role_status": "inactive",
        "club_name": "UHC Goal",
        "club_id": 351,
        "number": 0,
        "position": null,
        "captain": false,
        "weight": 0,
        "name": "Max Muster",
        "first": "Max",
        "last": "Muster",
        "license_number": 4518,
        "portrait": null,
        "entered_at": "1999-09-23",
        "left_at": "2004-06-30",
        "height": 0
      },
      "set": "for_role",
      "type": "Player",
      "id": 7295
    },
    "addresses/7295": {
      "attrs": {
        "public_address": true,
        "postal_address": true,
        "additional": null,
        "country": "CH",
        "canton": "BE",
        "location": "Ort",
        "zip_code": "3000",
        "street": "Strasse 1"
      },
      "set": "minimal",
      "type": "Address",
      "id": 7295
    }
  },
  "status": {
    "msg": "ok.",
    "code": 0
  }
}

Validate Password

Definition

PUT https://api-v2.swissunihockey.ch/bo/people/:id/validate_password

Tells whether the provided password is valid for the specified person.

You need password_validator rights in order to use this.

Parameters:

password
string

Sample response with valid password:


{
  "status": {
    "code": 0,
    "msg": "ok"
  },
  "payload": {
    "password": "valid"
  }
}

Sample response with invalid password:

{
  "status": {
    "code": 0,
    "msg": "ok"
  },
  "payload": {
    "password": "invalid"
  }
}