CHPP Development/XML/matchLineup

From Hattrick

Contents


CHPP Documentation - matchLineup.asp

This page offers XML and HTML interfaces to see the lineup, team experience and player ratings for a certain team and match. The XML interface enables CHPP developers to integrate these data into their applications.

Important!
Please note that it is strictly forbidden to develop applications that works with this or other XML/hrf files unless you are a CHPP developer. It is also illegal to use other applications than standard browsers or CHPP approved programs to access the data on the site. Violation of these rules might render you to lose your team.
Only the XML version of this file may be included in CHPP applications.

Current version

Current version of the XML output is 1.1

Syntax

matchLineup.asp?
     outputType = {HTML | XML}
     actionType = {view | lastmatch}
     [matchID = integer]
     [teamID = integer]

Indata parameters

outputType

Indicates whether the output to the client should be an HTML document or an XML file. Only the XML document may be used for CHPP use.

actionType

Indicates what type of action the page should perform. Only the view is available for XML use.

Value Default Description
view Default if matchID is provided View a specified match. If provided, a matchID must be sent.
lastmatch Default if matchID is not provided View the data for the latest match of the specified team.

matchID

Specifies which particular match data is requested for. If matchID is not specified, actionType will automatically default to lastmatch.

teamID

If actionType = view, TeamID specifies which of the two participating teams data shuld be shown for. If actionType = lastmatch (or if matchID is not specified), TeamID indicates which team the latest lineup should be retrieved for. If TeamID is not specified, it will default to the logged on user's team.

Outdata parameters

The XML output can contain the following tags/containers:

HattrickData

Generic tag wrapped around all XML data from Hattrick.

FileName (Within HattrickData)

The name of the file that your request was sent to.

UserID (Within HattrickData)

The logged on User's UserID (not to be confused with TeamID). If not logged on, it defaults to 0.

Version (Within HattrickData)

The current version number of the XML output.

FetchedDate (Within HattrickData)

Date and time when the XML file was fetched. Format is YYYY-MM-DD HH:MM:SS.

MatchID (Within HattrickData)

The ID number of the match the output is relevant for.

HomeTeam (Within HattrickData)

The home (formal, not taking arena location into account) team of the match.

HomeTeamID (Within HomeTeam)

The globally unique teamID of the home team.

HomeTeamName (Within HomeTeam)

The team name of the home team in the match.

AwayTeam (Within HattrickData)

The away (formal, not taking arena location into account) team of the match. An attribute named ID indicates the TeamID of the away team.

AwayTeamID (Within AwayTeam)

The globally unique teamID of the away team.

AwayTeamName (Within AwayTeam)

The team name of the away team in the match.

MatchType (Within HattrickData)

Integer defining the type of match:

MatchType Description
1 League match.
2 Qualification match.
3 Cup match (standard league cup).
4 Friendly (normal rules).
5 Friendly (cup rules).
6 Not currently in use, but reserved for international competition matches with normal rules (may or may not be implemented at some future point).
7 Hattrick Masters
8 International friendly (normal rules).
9 International friendly (cup rules).
10 National teams competition match (normal rules).
11 National teams competition match (cup rules).
12 National teams friendly.

Arena (Within HattrickData)

The arena that the match was played on.

ArenaID (Within Arena)

The globally unique arenaID.

ArenaName (Within Arena)

The name of the arena.

MatchDate (Within HattrickData)

The kick-off date of the match.

Team (Within HattrickData)

Container for the data for the requested team.

TeamID (Within Team)

The globally unique teamID.

TeamName (Within Team)

The team's full name.

ExperienceLevel (Within Team)

The aggregated experience level of the team, coded into an integer, with 1 indicating disastrous, 2 indicating wretched and so forth.

Lineup (Within Team)

Container for the lineup of the requested team.

Player (Within Lineup)

Container for a particular player that is part of the lineup. An attribute named Index gives a counter.

PlayerID (Within Player)

The globally unique playerID.

RoleID (Within Player)

An integer indicating which formal "slot" (Role) the player has filled in the match, before the repositionings take effect. So, there can only be one (or zero) player with a particular RoleID (contrary to how PositionCode works). Roles are coded like this:

RoleID Description
1 Keeper.
2 Right back.
3 Central Defender 1.
4 Central Defender 2.
5 Left Back.
6 Right winger.
7 Inner Midfield 1.
8 Inner Midfield 2.
9 Left winger.
10 Forward 1.
11 Forward 2.
12 Substitution (Keeper).
13 Substitution (Defender).
14 Substitution (Inner Midfield).
15 Substitution (Winger).
16 Substitution (Forward).
17 Set Pieces.
18 Captain.
19 Replaced player 1.
20 Replaced player 2.
21 Replaced player 3.

PlayerName (Within Player)

The full name of the player.

RatingStars (Within Player)

The number of stars the player is rated for.

PositionCode (Within Player)

An integer indicating the position the player played at, after repositioning (behaviour) has been taken into account. So, there can be several players with PositionCode 10 (Forward 1). Players who are not on the field do not get a PositionCode. Strictly speaking, PositionCode could be calculated using RoleID and Behaviour and is formally redundant, but it is provided anyway. PositionCodes are coded like this:

PositionCode Description
1 Keeper.
2 Right back.
3 Central Defender 1.
4 Central Defender 2.
5 Left Back.
6 Right winger.
7 Inner Midfield 1.
8 Inner Midfield 2.
9 Left winger.
10 Forward 1.
11 Forward 2.

Behaviour (Within Player)

An integer indicating the individual order or repositioning that the player has played with:

Behaviour Description
0 Normal.
1 Offensive.
2 Defensive.
3 Towards Middle.
4 Towards Wing.
5 Extra forward.
6 Extra inner midfield.
7 Extra defender.