Suomisport OpenID Connect API

OpenID Connect API for Suomisport.
More information: http://www.olympiakomitea.fi/suomisport
Contact Info: suomisport@olympiakomitea.fi
Version: 1.0
BasePath:/api/openid/v1
Proprietary License
http://www.olympiakomitea.fi/suomisport

Access

  1. HTTP Basic Authentication

Methods

[ Jump to Models ]

Table of Contents

Metadata

Products

Userdata

Metadata

Up
get /metadata/scopes
List client scopes (listClientScopes)
List the allowed scopes for the OpenID Connect client

Request headers

Return type

array[OpenIDConnectScope]

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

The list of applicable scopes for the client

401

The OpenID Connect client was not found or the authentication parameters were incorrect.

Products

Up
get /products/{productType}
Get user's product information (getProducts)

Returns the requested type of user's products. The products are returned in the order of the product validity start time.

The event registration may contain additional products the user has selected at the time of the event registration.

Path parameters

productType (required)
Path Parameter — The product type

Query parameters

validAfter (optional)
Query Parameter

Filter for validity of the product. Defines the start time for the validity.

If the validAfter filter is not defined but the validBefore is defined, the query is not bound by the start value and will return all products valid before the validBefore time.

If neither the validAfter nor the validBefore filters are defined, the validAfter is set to current time.

format: date-time
validBefore (optional)
Query Parameter

Filter for validity of the product. Defines the end time for the validity.

If the validBefore filter is not defined but the validAfter is defined, the query is not bound by the end value and will return all products valid after the validAfter time.

If neither the validAfter nor the validBefore filters are defined, the validAfter is set to current time.

format: date-time
includeDeleted (optional)
Query Parameter — Include deleted products in the results. Default value is not to include deleted (false). default: false

Return type

array[Product]

Example data

Content-Type: application/json
{
  "userContent" : "true",
  "additionalProducts" : [ {
    "id" : "ADP:128",
    "name" : "T-shirt",
    "userContent" : "Size XL",
    "updatedAt" : "2019-04-02T11:20:44.804+03:00",
    "productPrototype" : {
      "id" : "PADP:410:993",
      "type" : "additional_product"
    }
  }, {
    "id" : "ADP:129",
    "name" : "Great Coach book",
    "updatedAt" : "2019-04-02T11:20:44.805+03:00",
    "productPrototype" : {
      "id" : "PADP:411:994",
      "type" : "additional_product"
    }
  } ],
  "organization" : {
    "name" : "Suomen Esimerkkiliitto ry.",
    "id" : 2422,
    "shortName" : "Esimerkkiliitto"
  },
  "name" : "Harrastelisenssi",
  "validUntil" : "2000-01-23T04:56:07.000+00:00",
  "primarySport" : {
    "name" : "Kännykänheitto",
    "id" : 82
  },
  "productPrototype" : {
    "organization" : {
      "name" : "Suomen Esimerkkiliitto ry.",
      "id" : 2422,
      "shortName" : "Esimerkkiliitto"
    },
    "licencePeriod" : {
      "name" : "Kausi 2018-2019",
      "id" : 29922,
      "periodStart" : "2000-01-23T04:56:07.000+00:00",
      "periodEnd" : "2000-01-23T04:56:07.000+00:00"
    },
    "id" : "PLIC:1882",
    "type" : "licence"
  },
  "id" : "LIC:29928",
  "validFrom" : "2000-01-23T04:56:07.000+00:00",
  "grantedAt" : "2000-01-23T04:56:07.000+00:00",
  "additionalDetails" : [ {
    "id" : "ADD:192",
    "name" : "Experience as a coach?",
    "userContent" : "Four years in the ivy league",
    "updatedAt" : "2019-04-02T11:20:44.806+03:00",
    "productPrototype" : {
      "id" : "PADD:82",
      "type" : "additional_details"
    }
  } ],
  "updatedAt" : "2000-01-23T04:56:07.000+00:00"
}

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

The list of user's products of the requested type.

400

The request parameters were invalid. The response contains the error description. RequestError

Userdata

Up
get /user-info
Get user information (getUserInfo)
Returns basic information of logged in user

Return type

UserInfo

Example data

Content-Type: application/json
{
  "sub" : "21299922",
  "sport_id" : 12345678,
  "email_verified" : true,
  "address" : {
    "street_address" : "Radiokatu 20",
    "country" : "FI",
    "country_code" : "FI",
    "formatted" : "Radiokatu 20 00020 Helsinki\n",
    "locality" : "Helsinki",
    "postal_code" : "00020",
    "region" : "CA"
  },
  "birthdate" : "2000-01-23",
  "gender" : "male",
  "phone_number_verified" : true,
  "preferred_username" : "preferred_username",
  "given_name" : "John",
  "locale" : "fi-FI",
  "picture" : "picture",
  "nationality" : "nationality",
  "updated_at" : 1542115109,
  "user_id" : 29298774,
  "name" : "John Henderson the 3rd",
  "nickname" : "Joe",
  "phone_number" : "+358401234567",
  "family_name" : "Smith",
  "email" : "user@email.com"
}

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

UserInfo of the requesting user token. The scopes assigned to the OpenID Connect access token limit the values available in the response. The "openid" scope is mandatory and results in the sub claim. UserInfo

Models

[ Jump to Methods ]

Table of Contents

  1. Address -
  2. LicencePeriod - licencePeriod
  3. OpenIDConnectScope - scopes
  4. OrganizationData -
  5. Product - product
  6. ProductPrototype - productPrototype
  7. ProductType - productType
  8. RequestError - requestError
  9. SportData -
  10. UserInfo - userInfo

Address - Up

Postal address
formatted
String Formatted address string
streetUnderscoreaddress
String The street address
postalUnderscorecode
String The postal code
locality
String City or locality component, e.g. the post office name
region (optional)
String State, province, prefecture, or region component
country (optional)
String Country name component. Currently only the two-letter ISO 3166-1 alpha-2 code.
countryUnderscorecode
String The two-letter ISO 3166-1 alpha-2 country code

LicencePeriod - licencePeriod Up

Licence period for a sports federation
id
Long The licence period ID format: int64
name
String The licence period name
periodStart
Date The start time of the licence period format: date-time
periodEnd
Date The end time of the licence period format: date-time

OpenIDConnectScope - scopes Up

OpenID Connect Scopes - openid : the OpenID Connect marker scope. - offline_access : request offline access via refresh token - profile : OpenID Connect profile scope. Note: birthdate must be enabled separately and is not included in profile! - email : OpenID Connect email scope. - address : OpenID Connect address scope. - phone : OpenID Connect phone scope. - birthdate : OpenID Connect birthdate claim. Not included in the profile scope. - name : Just the name claims of the user (full name, given_name, family_name, nickname). - s_user_id : Suomisport user id claims. Includes Sport-ID and Suomisport user-id. - "s_product" : All Suomisport products (licences, insurances, memberships, event registrations and merits) - "s_licence" : Suomisport licences - "s_insurance" : Suomisport insurances - "s_membership" : Suomisport club and federation memberships - "s_event_registration" : Suomisport event registrations - "s_merit" : Suomisport merits

OrganizationData - Up

Organization information
id
Long The unique ID of the organization format: int64
name
String The organization name
shortName (optional)
String The organization short name

Product - product Up

Suomisport product the user has obtained.
id
String Unique identifier of the product
name
String Product name
userContent (optional)
String

User-provided content for the product. Used for example to contain user-provided responses to event registration additional questions (free text) or yes/no conditions (check box). User provided free text will be included as-is, conditions are reported as "true" for checked check box, "false" for non-checked box. The userContent is applicable to types:

  • additional_product : the user choice of products if applicable (e.g. T-shirt size)
  • additional_detail : the user's response to an additional detail question
grantedAt (optional)
Date The moment the product was granted to the user. format: date-time
validFrom (optional)
Date The validity start time for the product. format: date-time
validUntil (optional)
Date The validity end time for the product. format: date-time
updatedAt
Date Time the product's information was last updated. format: date-time
productPrototype
additionalProducts (optional)
array[Product] Additional products purchased with the current product
additionalDetails (optional)
array[Product] User responses to questions attached to a product. For example, an event may contain free-text questions for which the user must response during the event registration. The questions and user responses will be included here.
organization (optional)
primarySport (optional)

ProductPrototype - productPrototype Up

Product prototype for the user product. Contains the definition of the products including the product prototype ID, the product type and optionally the seller organization information and seller sport federation licence period information.
id
String Unique ID for the prototype
type
organization (optional)
licencePeriod (optional)

ProductType - productType Up

The type of the product

RequestError - requestError Up

Description of an error occurred during an API request.
errorCode
String Error code for the error.
errorDescription
String Human-readable description of the error.

SportData - Up

Sport information
id
Long The unique ID of the sport format: int64
name
String The name of the sport

UserInfo - userInfo Up

OpenID Connect User Information API response
sub
String Unique (for the requesting client) user identifier
sportUnderscoreid (optional)
Long User sport id format: int64
userUnderscoreid (optional)
Long User unique Suomisport identifier format: int64
name (optional)
String User full name
givenUnderscorename (optional)
String User first name
nickname (optional)
String User nickname, ie. the name the user wishes himself/herself to be called
familyUnderscorename (optional)
String User last name
email (optional)
String User email address
emailUnderscoreverified (optional)
Boolean True if the email address is verified
phoneUnderscorenumber (optional)
String User phone number
phoneUnderscorenumberUnderscoreverified (optional)
Boolean True if the phone number is verified
address (optional)
birthdate (optional)
date User date of birth format: date
gender (optional)
String User gender
Enum:
male
female
other
na
nationality (optional)
String User nationality, ISO 3166-1 alpha-2
preferredUnderscoreusername (optional)
String The Suomisport username of the user
locale (optional)
String The user's locale in Suomisport
Enum:
fi-FI
sv-SE
en-GB
picture (optional)
String URL of the user profile picture
updatedUnderscoreat (optional)
Long Time the End-User's information was last updated. format: int64