# Difference between revisions of "PC² REST services"

m (added urls) |
m (→scoreboard: add sample) |
||

Line 31: | Line 31: | ||

https://localhost:50443/scoreboard | https://localhost:50443/scoreboard | ||

+ | Sample output | ||

+ | |||

+ | <tt> | ||

+ | [{"rank":1,"team":9,"score":{"num_solved":5,"total_time":665},"problems":[{"label":"A","num_judged":2,"num_pending":0,"solved":true,"time":18,"first_to_solve":true},{"label":"B","num_judged":1,"num_pending":0,"solved":true,"time":125,"first_to_solve":false},{"label":"C","num_judged":1,"num_pending":0,"solved":true,"time":100,"first_to_solve":true},{"label":"D","num_judged":1,"num_pending":0,"solved":true,"time":167,"first_to_solve":false},{"label":"E","num_judged":0,"num_pending":0,"solved":false},{"label":"F","num_judged":2,"num_pending":0,"solved":true,"time":235,"first_to_solve":false},{"label":"G","num_judged":0,"num_pending":0,"solved":false}]},{"rank":2,"team":16,"score":{"num_solved":5,"total_time":832},"problems":[{"label":"A","num_judged":2,"num_pending":0,"solved":true,"time":19,"first_to_solve":false},{"label":"B","num_judged":3,"num_pending":0,"solved":true,"time":105,"first_to_solve":false},{"label":"C","num_judged":3,"num_pending":0,"solved":true,"time":197,"first_to_solve":false},{"label":"D","num_judged":1,"num_pending":0,"solved":true,"time":223,"first_to_solve":false},{"label":"E","num_judged":0,"num_pending":0,"solved":false},{"label":"F","num_judged":1,"num_pending":0,"solved":true,"time":188,"first_to_solve":false},{"label":"G","num_judged":0,"num_pending":0,"solved":false}]},{"rank":3,"team":8,"score":{"num_solved":4,"total_time":485},"problems":[{"label":"A","num_judged":1,"num_pending":0,"solved":true,"time":21,"first_to_solve":false},{"label":"B","num_judged":2,"num_pending":0,"solved":true,"time":35,"first_to_solve":true},{"label":"C","num_judged":0,"num_pending":0,"solved":false},{"label":"D","num_judged":0,"num_pending":0,"solved":false},{"label":"E","num_judged":2,"num_pending":0,"solved":true,"time":186,"first_to_solve":true},{"label":"F","num_judged":3,"num_pending":0,"solved":true,"time":183,"first_to_solve":true},{"label":"G","num_judged":0,"num_pending":0,"solved":false}]},{"rank":4,"team":4,"score":{"num_solved":4,"total_time":519},"problems":[{"label":"A","num_judged":1,"num_pending":0,"solved":true,"time":29,"first_to_solve":false}] | ||

+ | </tt> | ||

=See Also= | =See Also= |

## Revision as of 11:38, 11 September 2016

CCS REST service were added to pc2 as a way to provide contest data.

REST services are in version 9.3.2 and later versions of pc2.

## Contents

# Starting REST Services

See

# REST Services

All REST services produce JSON output.

## teams

Fetch data use this URL in a browser:

https://localhost:50443/teams

## problems

Fetch data use this URL

https://localhost:50443/problems

## languages

Fetch data use this URL

https://localhost:50443/languages

## scoreboard

Fetch data use this URL

https://localhost:50443/scoreboard

Sample output

`
[{"rank":1,"team":9,"score":{"num_solved":5,"total_time":665},"problems":[{"label":"A","num_judged":2,"num_pending":0,"solved":true,"time":18,"first_to_solve":true},{"label":"B","num_judged":1,"num_pending":0,"solved":true,"time":125,"first_to_solve":false},{"label":"C","num_judged":1,"num_pending":0,"solved":true,"time":100,"first_to_solve":true},{"label":"D","num_judged":1,"num_pending":0,"solved":true,"time":167,"first_to_solve":false},{"label":"E","num_judged":0,"num_pending":0,"solved":false},{"label":"F","num_judged":2,"num_pending":0,"solved":true,"time":235,"first_to_solve":false},{"label":"G","num_judged":0,"num_pending":0,"solved":false}]},{"rank":2,"team":16,"score":{"num_solved":5,"total_time":832},"problems":[{"label":"A","num_judged":2,"num_pending":0,"solved":true,"time":19,"first_to_solve":false},{"label":"B","num_judged":3,"num_pending":0,"solved":true,"time":105,"first_to_solve":false},{"label":"C","num_judged":3,"num_pending":0,"solved":true,"time":197,"first_to_solve":false},{"label":"D","num_judged":1,"num_pending":0,"solved":true,"time":223,"first_to_solve":false},{"label":"E","num_judged":0,"num_pending":0,"solved":false},{"label":"F","num_judged":1,"num_pending":0,"solved":true,"time":188,"first_to_solve":false},{"label":"G","num_judged":0,"num_pending":0,"solved":false}]},{"rank":3,"team":8,"score":{"num_solved":4,"total_time":485},"problems":[{"label":"A","num_judged":1,"num_pending":0,"solved":true,"time":21,"first_to_solve":false},{"label":"B","num_judged":2,"num_pending":0,"solved":true,"time":35,"first_to_solve":true},{"label":"C","num_judged":0,"num_pending":0,"solved":false},{"label":"D","num_judged":0,"num_pending":0,"solved":false},{"label":"E","num_judged":2,"num_pending":0,"solved":true,"time":186,"first_to_solve":true},{"label":"F","num_judged":3,"num_pending":0,"solved":true,"time":183,"first_to_solve":true},{"label":"G","num_judged":0,"num_pending":0,"solved":false}]},{"rank":4,"team":4,"score":{"num_solved":4,"total_time":519},"problems":[{"label":"A","num_judged":1,"num_pending":0,"solved":true,"time":29,"first_to_solve":false}]
`