CHPP Development/XML/matches: Difference between revisions

From Hattrick
Jump to navigationJump to search
Neohugin (talk | contribs)
mNo edit summary
RebelClown (talk | contribs)
m Category
 
(8 intermediate revisions by 3 users not shown)
Line 1: Line 1:
__TOC__
This page offers XML and HTML interfaces to see the the moste recent and upcoming '''matches''' for a particular team. The XML interface enables CHPP developers to integrate these data into their applications.  
This page offers XML and HTML interfaces to see the the moste recent and upcoming '''matches''' for a particular team. The XML interface enables CHPP developers to integrate these data into their applications.  


{{CHPP Documentation}}


== Current version ==
{{XML Current version | version=2.2}}
Current version of the XML output is 2.2


 
==Syntax==
== Syntax ==
<code>
matches.asp?
matches.asp?
       outputType = {HTML | XML}
       outputType = {HTML | XML}
       actionType = {view | refreshCache}
       actionType = {view | refreshCache}
       [teamID = integer]
       [teamID = integer]
       [LastMatchDate = Date]
       [LastMatchDate = Date]
</code>


==Indata parameters==


== Indata parameters ==
{{XML outputType}}
 
=== 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 ===
=== actionType ===
Indicates what type of action the page should perform.
Indicates what type of action the page should perform.


{| border="1" width="75%"
{| border="0" cellpadding="2" cellspacing="2"
|-
|- bgcolor="#cccccc" align="left"
! Value
! Value
! Default
! Default
! Description
! Description
|-
|- bgcolor="#dddddd" valign="top"
| view
| view
| Default
| Default
| View the match list of the team.
| View the match list of the team.
|-
|- bgcolor="#dddddd" valign="top"
| refreshCache
| refreshCache
|
|
Line 38: Line 37:
'''Important:''' Do not abuse this option. Excessive use of this option may force us to close it for XML/CHPP access. The cache files have intelligently chosen expiry dates and are normally fully up to date. Use of the refreshCache option should be restricted to something that happens when the end user actively choses to do so. And it should never be used more than once in 15 minutes.
'''Important:''' Do not abuse this option. Excessive use of this option may force us to close it for XML/CHPP access. The cache files have intelligently chosen expiry dates and are normally fully up to date. Use of the refreshCache option should be restricted to something that happens when the end user actively choses to do so. And it should never be used more than once in 15 minutes.
|}
|}


=== teamID ===
=== teamID ===
What team to show the matches for.
What team to show the matches for.


=== LastMatchDate ===
=== LastMatchDate ===
Last date to show matches to. If not set, default is 28 days in the future. If more than 50 matches are affected, only the 50 first will be returned. This option should not normally be used by CHPPs, since it bypass the cache.
Last date to show matches to. If not set, default is 28 days in the future. If more than 50 matches are affected, only the 50 first will be returned. This option should not normally be used by CHPPs, since it bypass the cache.


 
==Outdata parameters==
=== Outdata parameters ===
{{XML default outparams}}
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 ===
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.
 
 
=== FetchedDate (Within HattrickData) ===
Date and time when the XML file was fetched. Format is YYYY-MM-DD HH:MM:SS.
 


=== Team (Within HattrickData) ===
=== Team (Within HattrickData) ===
The team that the list applies to.
The team that the list applies to.


=== TeamID (Within Team) ===
=== TeamID (Within Team) ===
The team's TeamID.
The team's TeamID.


=== TeamName (Within Team) ===
=== TeamName (Within Team) ===
The full name of the team.
The full name of the team.


=== MatchList (Within Team) ===
=== MatchList (Within Team) ===
Container for the matches. An attribute named Count specifies how many matches it contains.
Container for the matches. An attribute named Count specifies how many matches it contains.


=== Match (Within MatchList) ===
=== Match (Within MatchList) ===
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).
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).


=== MatchID (Within Match) ===
=== MatchID (Within Match) ===
The globally unique identifier of the match.
The globally unique identifier of the match.


=== HomeTeam (Within Match) ===
=== HomeTeam (Within Match) ===
The Home (formal, not taking arena location into account) team of the match.
The Home (formal, not taking arena location into account) team of the match.


=== HomeTeamID (Within HomeTeam) ===
=== HomeTeamID (Within HomeTeam) ===
The teamID of the Home team in the match.
The teamID of the Home team in the match.


=== HomeTeamName (Within HomeTeam) ===
=== HomeTeamName (Within HomeTeam) ===
The team name of the Home team in the match.
The team name of the Home team in the match.


=== AwayTeam (Within Match) ===
=== AwayTeam (Within Match) ===
The away (formal, not taking arena location into account) team of the match.
The away (formal, not taking arena location into account) team of the match.


=== AwayTeamID (Within AwayTeam) ===
=== AwayTeamID (Within AwayTeam) ===
The teamID of the away team in the match.
The teamID of the away team in the match.


=== AwayTeamName (Within AwayTeam) ===
=== AwayTeamName (Within AwayTeam) ===
The team name of the away team in the match.
The team name of the away team in the match.


=== MatchDate (Within Match) ===
=== MatchDate (Within Match) ===
The start date (kick-off) of the match.
The start date (kick-off) of the match.


=== MatchType (Within Match) ===
=== MatchType (Within Match) ===
Integer defining the type of match:
Integer defining the type of match:
 
{{Template:Match type table}}
{| border="1" width="75%"
|-
! 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.
|}
 


=== HomeGoals (Within Match) ===
=== HomeGoals (Within Match) ===
The number of goals for the home team. If the match is still upcoming or ongoing, this tag is not sent.
The number of goals for the home team. If the match is still upcoming or ongoing, this tag is not sent.


=== AwayGoals (Within Match) ===
=== AwayGoals (Within Match) ===
The number of goals for the away team. If the match is still upcoming or ongoing, this tag is not sent.
The number of goals for the away team. If the match is still upcoming or ongoing, this tag is not sent.


=== Status (Within Match) ===
=== Status (Within Match) ===
A tristate string value specifying whether the match is FINISHED, ONGOING or UPCOMING.
A tristate string value specifying whether the match is FINISHED, ONGOING or UPCOMING.


=== OrdersGiven (Within Match) ===
=== OrdersGiven (Within Match) ===
A boolean value only supplied for upcoming matches (haven't started yet) of your own team that signifies whether you have given orders or not. If the request is for another team than your own (even if it is for your opponent), this data is not sent.
A boolean value only supplied for upcoming matches (haven't started yet) of your own team that signifies whether you have given orders or not. If the request is for another team than your own (even if it is for your opponent), this data is not sent.


 
[[Category:CHPP XML Pages|Matches]]
 
== Examples ==
Requests may be posted as either GET or POST.
 
=== Get the data for a specified team ===
matches.asp?outputType=XML&actionType=view&teamID=373
 
 
=== Get the data for your own team ===
matches.asp?outputType=XML&actionType=view
 
 
=== Get the data for your own team and order the server to make a cache refresh (please avoid excessive use) ===
matches.asp?outputType=XML&actionType=refreshCache

Latest revision as of 17:45, 23 March 2007

This page offers XML and HTML interfaces to see the the moste recent and upcoming matches for a particular team. 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 2.2

Syntax

matches.asp?
     outputType = {HTML | XML}
     actionType = {view | refreshCache}
     [teamID = integer]
     [LastMatchDate = Date]

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 team.
refreshCache Force the server to load the match data directly from the database instead of using the cache files that are normally used.

Important: Do not abuse this option. Excessive use of this option may force us to close it for XML/CHPP access. The cache files have intelligently chosen expiry dates and are normally fully up to date. Use of the refreshCache option should be restricted to something that happens when the end user actively choses to do so. And it should never be used more than once in 15 minutes.

teamID

What team to show the matches for.

LastMatchDate

Last date to show matches to. If not set, default is 28 days in the future. If more than 50 matches are affected, only the 50 first will be returned. This option should not normally be used by CHPPs, since it bypass the cache.

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.

Team (Within HattrickData)

The team that the list applies to.

TeamID (Within Team)

The team's TeamID.

TeamName (Within Team)

The full name of the team.

MatchList (Within Team)

Container for the matches. An attribute named Count specifies how many matches it contains.

Match (Within MatchList)

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).

MatchID (Within Match)

The globally unique identifier of the match.

HomeTeam (Within Match)

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

HomeTeamID (Within HomeTeam)

The teamID of the Home team in the match.

HomeTeamName (Within HomeTeam)

The team name of the Home team in the match.

AwayTeam (Within Match)

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

AwayTeamID (Within AwayTeam)

The teamID of the away team in the match.

AwayTeamName (Within AwayTeam)

The team name of the away team in the match.

MatchDate (Within Match)

The start date (kick-off) of the match.

MatchType (Within Match)

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.

HomeGoals (Within Match)

The number of goals for the home team. If the match is still upcoming or ongoing, this tag is not sent.

AwayGoals (Within Match)

The number of goals for the away team. If the match is still upcoming or ongoing, this tag is not sent.

Status (Within Match)

A tristate string value specifying whether the match is FINISHED, ONGOING or UPCOMING.

OrdersGiven (Within Match)

A boolean value only supplied for upcoming matches (haven't started yet) of your own team that signifies whether you have given orders or not. If the request is for another team than your own (even if it is for your opponent), this data is not sent.