Difference between revisions of "API"

From PC2wiki
Jump to: navigation, search
m (Status: added future enhancements section)
m (Future enhancements: add api sample section)
Line 51: Line 51:
 
A complete list of all API bugs can be found by clicking
 
A complete list of all API bugs can be found by clicking
 
[http://pc2.ecs.csus.edu/bugzilla/buglist.cgi?query_format=advanced&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&component=api here]
 
[http://pc2.ecs.csus.edu/bugzilla/buglist.cgi?query_format=advanced&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&component=api here]
 +
 +
=API Samples=
 +
 +
These are a number of samples/snippets using the API.
  
 
==See Also==
 
==See Also==
 
* [[Version 9]]
 
* [[Version 9]]

Revision as of 19:00, 16 January 2013

The PC² API (Application Programming Interface) is a set of Java interfaces and classes that provide a view into the contest data.

The API's goals are to allow developers to extend PC² while keeping complete integrity and security for the contest.

A developer will be able to create a Java class that can login and then retrieve information about the contest. The API provides a developer to get information about team's, runs, problems, languages and the standings. Complete standings can be retrieved when using a Judge or Board login.

Documentation

The API javadoc was added into the distribution in version 9.1.3 build 1899.

The main Java doc page is each distribution at doc/api/index.html.

The API provides code snippets for a number of activities including:

  1. Connect and login to a PC2 server
  2. Print data from all runs in the contest
  3. Print the name, site, and group of each team in the contest
  4. Print the names of all the currently defined contest languages
  5. Print the names of all the currently defined contest problems
  6. Print the names of all currently defined (allowable) judgements (that is, judgements which a Judge may choose to assign to a given submitted run)

Status

The API provides developers the ability to access and extend pc2. The API supports the following features:

  1. Login/Logoff
  2. Submit a run
  3. Add listeners to respond to events (run submitted, judged, etc.) as they occur
  4. Get contest information
  5. Get run info (judgements, status, etc)
  6. Get clarification info (answers, status, etc).
  7. Get scoring information

To ensure contest integrity there may be limited access to information depending on the login used. For example, if logged in as team5 the only run information and scoring information available will be fore team5. To have access to more data use a scoreboard or judge login account.

Future enhancements

The following bugs/enhancements are in the pc2 Bugzilla:

  • Bug 570 Implement "adduser" function in API
  • Bug 740 Add API method: submitClarification

A complete list of all API bugs can be found by clicking here

API Samples

These are a number of samples/snippets using the API.

See Also