CHPP Development/XML/CupMatches
CHPP Documentation - CupMatches.asp
This page offers XML and HTML interfaces to see the matches for a specific season and cupround for a cup. The XML interface enables CHPP developers to integrate these data into their applications.
N.B.: The page name starts with a capital, as opposed to all other page names.
Current version
Current version of the XML output is 1.1
Syntax
cupmatches.asp?
outputType = {HTML | XML}
actionType = view
CupID = integer
CupRound = integer
[Season = integer]
[StartAfterMatchID = 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.
| Value | Default | Description |
|---|---|---|
| view | Default | View the match list of the cup. A maximum of 256 matches are returned, ordered by matchid. For more matches, see parameter StartAfterMatchID. |
CupID
What cup to show the matches for.
Season
What season to show the matches for. Defaults to the current season for the cup, if no season is supplied.
CupRound
What cupround to show the matches for.
StartAfterMatchID
Optional parameter. If left out it defaults to 0 (zero). For large cups in the first round, there will be more than 256 matches to display. To be able to fetch the next 256 matches, take the last MatchID you received from the XML-output. Send it as StartAfterMatchID=<MatchID>. This will return the next 256 matches with MatchID > StartAfterMatchID.
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.
Version (Within HattrickData)
The current version number of the XML output.
UserID (Within HattrickData)
The logged on User's UserID (not to be confused with TeamID). If not logged on, it defaults to 0.
UserIsSupporter (Within HattrickData)
Indicated if the fetching user has a supporter subscription or not. Return 1 if the user has a supporter subscription. 0 otherwise.
UserHasClubhouse (Within HattrickData)
Indicated if the fetching user has a ClubHouse or not. Return 1 if the user has a ClubHouse. 0 otherwise.
FetchedDate (Within HattrickData)
Date and time when the XML file was fetched. Format is YYYY-MM-DD HH:MM:SS.
ActionType (Within HattrickData)
The requested ActionType.
ActionResult (Within HattrickData)
Has 1 attribute: "Success" with value 1 if everything went ok, otherwise 0. Content in ActionResult is OK if the request was successful, otherwise a short error message should be returned.
Cup (Within HattrickData)
Container for the cup and the matches.
CupID (Within Cup)
The global unique CupID
CupSeason (Within Cup)
The season of the matcehs.
CupRound (Within Cup)
The cupround of the matches.
CupName (Within Cup)
The name of the cup.
Matches (Within Cup)
Container for the matches. An attribute named Count specifies how many matches it contains. This is 0 if no matches exists.
Match (Within Matches)
A match. An attribute called Index signifies the number of the match in the list (not to be confused with MatchID which is globabbly unique). Index ranges from 0 to (Count - 1).
MatchID (Within Match)
The globally unique identifier of the match.
MatchDate (Within Match)
The start date (kick-off) of the match.
HomeTeamName (Within Match)
The team name of the Home team in the match.
AwayTeamName (Within Match)
The team name of the away team in the match.
MatchResult (Within Match)
Container for the match results. An attribute named Available with values true/false specifies whether or not the match result is available.
HomeGoals (Within MatchResult)
The number of goals for the home team. If the match is still upcoming or ongoing, this tag is not sent.
AwayGoals (Within MatchResult)
The number of goals for the away team. If the match is still upcoming or ongoing, this tag is not sent.
LeagueInfo (Within Match)
Container for information about the participating team's league. An attribute named Available with values true/false specifies whether or not the league information is available.
HomeLeagueID (Within LeagueInfo)
The LeagueID of the home team in the match.
AwayLeagueID (Within LeagueInfo)
The LeagueID of the away team in the match.
HomeLeagueName (Within LeagueInfo)
The league name of the home team in the match.
AwayLeagueName (Within LeagueInfo)
The league name of the away team in the match.