CHPP Development/XML/search

From Hattrick
Revision as of 17:48, 23 March 2007 by RebelClown (talk | contribs) (Category)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

CHPP Documentation - search.asp

This page offers XML and HTML interfaces to the search page. 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

search.asp?
     outputType = {HTML | XML}
     actionType = {view}
     searchWhat = {team | player | arena | region}
     searchType = {BEGINS | EQUALS}
     [loginName = string]
     [teamID = integer]
     [firstName = string]
     [lastName = string]
     [teamName = string]
     [playerID = integer]
     [regionName = string]
     [arenaName = string]

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 results of a query.

searchWhat

Indicates what to search for.

Value Default Description
BEGINS Default Finds strings that begins with the sought for value.
EQUALS Finds strings that equals the sought for value.

loginName

If this is provided, and searchWhat = "team", a search will be performed based on loginName. (This criterion has the highest priority within Team search).

firstName and lastName

These parameters has a dual function, being used for both searchWhat = "team" and searchWhat = "player".

If both these are provided, and searchWhat = "team" and loginName is not provided, a search will be performed based on the user's name as supplied upon application. Users who have opted to hide their name will not be found.

If both these are provided, and searchWhat = "player" and playerID is not provided, a search will be performed based on the player's name. There is no searching on nicknames available.

teamID

If this is provided, and searchWhat = "team" and none of firstName, lastName and loginName is provided, a search will be performed based on teamName. Only EQUALS searchType is available.

teamName

If this is provided, and searchWhat = "team" and none of teamID, firstName, lastName and loginName is provided, a search will be performed based on teamName. (This criterion has the lowest priority within Team search).

playerID

If this is provided, and searchWhat = "player" a search will be performed based on playerID. Only EQUALS searchType is available.

regionName

If this is provided, and searchWhat = "region" a search will be performed based on regionName.

arenaName

If this is provided, and searchWhat = "arena" a search will be performed based on arenaName.

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.

ActionType (Within HattrickData)

The initial actionType that was submitted for the page.

SearchWhat (Within HattrickData)

Returns the input searchWhat parameter.

SearchType (Within HattrickData)

Returns the input searchType parameter.

SearchResults (Within HattrickData)

Container for the search results. An attribute named Count indicate the number of records returned. No more than 50 records can be returned.

Result (Within SearchResults)

Container for a particular record within the search results. Has an attribute named Index.

ResultID (Within Result)

A globally unique record ID: teamID, playerID, regionID or arenaID depending on searchWhat.

ResultName (Within Result)

The full name of the team, player, region or arena.

MoreRecordsExist (Within SearchResults)

If there are more than 50 records available for the specified criteria, this will return true, otherwise false.

ErrorMessage (Within SearchResults)

If there was an error when performing the search, this contains the error message.