Skip to content

GetMappedPlayers Query

Retrieves the full list of mapped players from ClickHouse, providing a cross-reference between FOX Sports, NRL, and SuperCoach player identifiers.

Overview

The mapped players query is used by integration services to resolve player identities across multiple data providers. Each record links a single player's FOX feed ID, NRL ID, and SuperCoach ID together with their names from each source.

Authentication

  • Requires: ServiceAccount role
  • Interface: ISecureQuery
  • Access: Machine-to-machine only (Basic Auth)

Request

Query type: GetMappedPlayers

No parameters are required. The query returns all mapped players.

Sample request

POST /api/readmodel
Authorization: Basic <base64-encoded credentials>
Content-Type: application/json

{
  "query": {
    "queryType": "GetMappedPlayers"
  }
}
curl -X POST https://<host>/api/readmodel \
  -H "Content-Type: application/json" \
  -u "<service-account-email>:<password>" \
  -d '{
    "query": {
      "queryType": "GetMappedPlayers"
    }
  }'
using var client = new HttpClient();
var credentials = Convert.ToBase64String(
    Encoding.UTF8.GetBytes("<service-account-email>:<password>"));
client.DefaultRequestHeaders.Authorization =
    new AuthenticationHeaderValue("Basic", credentials);

var response = await client.PostAsync(
    "https://<host>/api/readmodel",
    new StringContent(
        """{ "query": { "queryType": "GetMappedPlayers" } }""",
        Encoding.UTF8,
        "application/json"));

var result = await response.Content.ReadFromJsonAsync<QueryResult<MappedPlayerContract>>();

Sample response

{
  "results": [
    {
      "foxId": 12345,
      "foxFirstName": "Nathan",
      "foxLastName": "Cleary",
      "foxFullName": "Nathan Cleary",
      "foxShortName": "N. Cleary",
      "nrlPlayerId": "67890",
      "nrlFirstName": "Nathan",
      "nrlLastName": "Cleary",
      "supercoachId": 54321,
      "supercoachCompositeId": "54321-2026",
      "luckboxId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "luckboxFullName": "Nathan Cleary",
      "luckboxSlug": "nathan-cleary"
    }
  ],
  "totalCount": 1
}

Response

Each item in the result set is a MappedPlayerContract:

Field Type Description
FoxId int Player ID in the FOX Sports feed
FoxFirstName string Player first name from FOX Sports
FoxLastName string Player last name from FOX Sports
FoxFullName string Player full name from FOX Sports
FoxShortName string Player short name from FOX Sports
NrlPlayerId string Player ID in the NRL database
NrlFirstName string Player first name from NRL
NrlLastName string Player last name from NRL
SupercoachId int Player ID in SuperCoach
SupercoachCompositeId string Composite SuperCoach identifier
LuckboxId Guid? LuckBox participant ID (nullable)
LuckboxFullName string Player full name from LuckBox
LuckboxSlug string Player slug from LuckBox

Data Source

Player mappings are stored in ClickHouse and queried via a saved query endpoint. The ClickHouse connection requires KeyId and KeySecret credentials configured under ClickHouse:QueryEndpoint in application settings.

File Locations

Component Path
Query src/Integration/LBS.Fantasy.Integration/Queries/MappedPlayer/GetMappedPlayersQuery.cs
Handler src/Integration/LBS.Fantasy.Integration/Queries/MappedPlayer/GetMappedPlayersQueryHandler.cs
Response contract src/Integration/LBS.Fantasy.Integration/Queries/MappedPlayer/MappedPlayerContract.cs
Data model src/DataHarvesters/LBS.Data.Harvester/NRL/Models/MappedPlayer.cs
Credentials src/DataHarvesters/LBS.Data.Harvester/ClickHouse/ClickHouseQueryCredentials.cs

Module

Requires ModuleDefinition.SportCore to be enabled.