XTS API
From EUTC Wiki
Contents |
[edit] XTS Application Programming Interface
Correct (though incomplete) as of 2008-07-18 (RC1 "Fat Cat")
[edit] General Errors
These errors can occur when calling any command, or when calling a command incorrectly. Errors are returned as an #<error> document.
- 401 notAuthorised You are not authorised to perform the action. You may need to supply a password, or it might simply be impossible to do what you want to do from the machine you're on.
- 400.1 unrecognisedCommand The command is not recognised. Either you spelled it wrong, the API has changed since the documentation was written or you're simply doing it wrong.
[edit] Commands
[edit] getshows
[edit] Parameters
- No parameters (yet)
[edit] Returns
A <shows> document containing #<showsummary>s representing all shows in the database.
[edit] Errors
- Never returns an error.
[edit] getshow
[edit] Parameters
- showid The ID of the show to get.
[edit] Returns
A #<show> representing the show.
[edit] Errors
- 404.3 showNotFound if the show doesn't exist in the database.
[edit] getperformances
[edit] Parameters
- showid The ID of the show to get the performances of.
[edit] Returns
A <performances> document containing #<performance>s representing all performances for the specified show.
[edit] Errors
- 404.3 showNotFound if the show doesn't exist in the database.
[edit] getperformance
[edit] Parameters
- performanceid The ID of the performance to get.
[edit] Returns
A #<performance> representing the performance.
[edit] Errors
- 404.2 performanceNotFound if the performance doesn't exist in the database.
[edit] XML
[edit] <error>
Details an error that occured while processing your request.
[edit] Elements
- @type The type number of the error, consists of a major and an (optional) minor part separated by a decimal point.
- <message> A human-readable description of the error.
[edit] Example
<error type="400.1"> <message>Unrecognised command.</message> </error>
[edit] <showsummary>
Gives some summary details about a show in the database.
[edit] Elements
- <id> The ID of the show.
- <name> The name of the show.
- <tagline> The show's tagline / strapline / subtitle.
[edit] Example
<showsummary> <id>1</id> <name>Alice In Wonderland</name> <tagline>Texas Woman's University</tagline> </showsummary>
[edit] <show>
A <show> tag describes a single show in the database.
[edit] Elements
- <id> The ID of the show.
- <name> The name of the show.
- <tagline> The show's tagline / strapline / subtitle.
- <description> The show's description, if supplied. The usefulness of this field is debatable. I imagined it would carry publicity information that could be insta-formatted into web pages on the Bedlam Theatre website. Perhaps we should leave this tag as "reserved for future deprecation".
[edit] Example
<show> <id>15</id> <name>Assassins</name> <tagline>Rather Like a Shark/DULOG</tagline> <description/> </show>
[edit] <performance>
A <performance> tag describes a single performance in the database.
[edit] Elements
- <id> The ID of the performance.
- <showid> The ID of the performance.
- <start> The start time of the performance in seconds since the UNIX epoch.
- <startdatetime> The human-readable start time of the performance.
- <tickets> Ticket details incorporating:
- <total> The total number of seats for the performance (ie the maximum number of tickets that can be sold).
- <sold> The number of tickets that have been sold (net).
- <booked> The number of tickets that are still booked (ie, awaiting collection).
- <heldback> The number of tickets that are held back, ie, reserved for later sale.
- <remaining> The number of tickets that are immediately available for sale.
[edit] Example
<performance>
<id>1</id>
<showid>1</showid>
<start>1217841300</start>
<startdatetime>2008-08-04 10:15</startdatetime>
<tickets>
<total>90</total>
<sold>0</sold>
<booked>1</booked>
<heldback>18</heldback>
<remaining>71</remaining>
</tickets>
</performance>