- Sphere Engine overview
- Compilers
- Overview
- API
- Widgets
- Resources
- Problems
- Overview
- API
- Widgets
- Handbook
- Resources
- Containers
- Overview
- Glossary
- API
- Workspaces
- Handbook
- Resources
- RESOURCES
- Programming languages
- Modules comparison
- Webhooks
- Infrastructure management
- API changelog
- FAQ
The following article summarizes the changes made to Sphere Engine API.
API v1.1 for Containers module
Along with the introduction of the Sphere Engine Containers module, we introduced a new API. It is as consistent as possible with the existing API V4 for the Compilers and the Problems modules.
For more information refer to:
API v4 vs API v3 for Compilers and Problems module
The following section summarizes changes between the 3rd and 4th versions of Sphere Engine API. Among numerous new features, functional and performance improvements, and bug fixes there are many changes in the API interface, for example:
- new methods, parameters, and fields in responses,
- unification in naming and structure,
- better semantic data grouping in responses,
- removal of deprecated methods, parameters, and fields in responses.
The list of changes is designed to be a convenient source of information during the migration process.
Common for Compilers and Problems API
Added
- added support for multi-file submissions (see multi-file mode),
- added support for disk operations in submitted programs (see disk operations),
- added support for multiple versions of languages (e.g., C++ (gcc 5.1), C++ (gcc 6.3)),
- added extended error codes (field
error_code
) to API responses in case of errors; this change makes it possible to precisely identify errors, - added multiple new error types in various API methods,
- added new fields in parameters related to multiple versions of languages in various methods (in both parameters and field in responses),
- added information about languages versions to the response of
GET /compilers
method response, - added new field
executing
to the submission details inGET /submissions/:id
andGET /submissions
methods responses, - added new field
result.streams
to the submission details inGET /submissions/:id
method response, - added new field
uri
to the submission details inGET /submissions
method response, - added new parameters
compilerVersionId
,files
toPOST /submissions
method.
Changed
- unified naming standard for data streams (
stdin
->input
,stdout
->output
,stderr
->error
,cmperr
->cmpinfo
,psinfo
->debug
) in various methods, - modified structure of
GET /compilers
method response, - significant changes in the structure of
GET /submissions/:id
andGET /submissions
methods responses, - data that is not yet available to be retrieved is presently shown as
null
in method responses (e.g., while the submission is in the middle of processing there is no information about execution time, thus, returned value isnull
; previously in such cases0
was returned).
Removed
- removed submission streams data (i.e., source, input, output, error, cmpinfo, debug) from the
GET /submissions/:id
method response; this change eliminates potential issues with binary data in streams, - removed default values for
compilerId
andsource
parameters fromPOST /submissions
; both parameters are now required.
Compilers API
Added
- added support for output-files (see output files),
- added new parameters
timeLimit
,memoryLimit
toPOST /submissions
method.
Changed
- api endpoint is now
{customer_key}.compilers.sphere-engine.com
instead of its former versionfor consistency with Problems API,{customer_key}.api.compilers.sphere-engine.com
- modified structure of
GET /test
method response to be consistent with the same method in Problems API, - format of date in
GET /submissions/:id
andGET /submissions
methods responses is nowYYYY-MM-DD hh:mm:ss +Z
instead ofYYYY-MM-DD hh:mm:ss
(i.e., information about time zone is added), - integer-type field
status
in submission details inGET /submissions
andGET /submissions/:id
methods responses has been replaced with complex-type structure with two fields, i.e.,result.status.code
andresult.status.name
, - values from field
result
are merged with values fromstatus
field in submission details inGET /submissions
andGET /submissions/:id
methods responses; the merged value is stored in fieldresult.status.code
.
Removed
- removed field
error
from responses of all methods, - removed deprecated
GET /languages
that was redundant due to existence ofGET /compilers
method, - removed deprecated field
langId
,langName
,langVersion
,public
andcompiler.ver
in submission details inGET /submission/:id
andGET /submissions
methods responses, - removed field
output_type
fromGET /submission/:id
method response, - removed field
result
fromGET /submission/:id
method response in its former interpretation; currently, presentresult
field aggregates all data generated during runtime of the program, - removed parameters
withSource
,withInput
,withOutput
,withStderr
andwithCmpinfo
fromGET /submission/:id
method, - removed deprecated
sourceCode
andcompiler
parameters fromPOST /submissions
method.
Problems API
Added
- added method
GET /submissions/:id/:stream
for retrieving data from submission streams (i.e., source, output, error, cmpinfo, debug), - added optional parameter
tests
to methodPOST /submissions
; this parameter allows selecting of test cases for which a submission will be tested, - added new field
id
toPOST /problems
method response, - added new field
id
to problem details inGET /problems
andGET /problems/:id
methods responses, - added method
DELETE /problems/:id
for removing programming problems, - added new field
uri
to the test case details inGET /problems/:code/testcases
method response, - added new field
data
toGET /problems/:code/testcases/:number
method response, - added new field
visibility
to judge details inGET /judges
andGET /judges/:id
methods responses, - added new field
compiler.version
toGET /judges/:id
method response, - added method
GET /judges/:id/:filename
for retrieving judge files, - added new parameter
shared
toPOST /judges
method response, - added new parameter
shared
toPUT /judges
method response.
Changed
- the "code" of the programming problem has been replaced with the "id" of the integer type; this change affects various methods that were previously based on the "code"; it is still possible to use the "code", however, it is deprecated; new integrations should use the "id" as the unique identifier for programming problem,
- string-type field
status
in submission details (and test cases details) inGET /submissions
andGET /submissions/:id
methods responses has been replaced with a complex-type structure with two fields, i.e.,result.status.code
andresult.status.name
(andresult.testcases[].status.code
,result.testcases[].status.name
), - many fields in API responses now have proper type (e.g.,
result.testcases[].number
is now integer, not string), - significant changes in the structure of
GET /problems/:id
andGET /problems
methods responses, - string-type parameter
type
inPOST /problems
method has been replaced with int-typetypeId
parameter; mapping between both parameters is as follows: binary - 0, minimize - 1, maximize - 2, - parameter
masterjudgeId
inPOST /problem
method is now required, - fields
paging.next
andpaging.prev
are always present in response forGET /problems
andGET /judges
methods; if there is no previous or next page, then the value of the respective field is equal tonull
, - field
shortBody
is always present in problem details inGET /problems
andGET /problems/:id
methods responses; if the content of theshortBody
field was not demanded, then its value is equal tonull
, - field
actions
in problem details inGET /problems
andGET /problems/:id
methods responses has been renamed topermissions
, - fields
lastModifedBody
andlastModifiedSettings
in problem details inGET /problems
andGET /problems/:id
methods responses are reorganized to belastModified.body
andlastModified.settings
respectively, - string-type field
type
inGET /problems/:id
method response has been extended to complex-type structure with two fields, i.e.,type.id
andtype.name
, - parameter
judgeId
inPOST /problems/:id/testcases
is now required, - parameter
timelimit
inPOST /problems/:id/testcases
method has been renamed totimeLimit
, - field
testcases
inGET /problems/:code/testcases
method response has been renamed toitems
for consistency with other methods returning collections, - fields
input
andoutput
inGET /problems/:code/testcases/:number
method response are now fields of newly addeddata
field; therefore, these fields are now accessible asdata.input
anddata.output
respectively, - string-type field
type
in judge details inGET /judges
andGET /judges/:id
methods responses has been extended to a complex-type structure with two fields, i.e.,type.id
andtype.name
, - string-type field
type
inGET /judges/:id
method response has been reorganized to a complex-type structure with two fields, i.e.,source.size
andsource.uri
, - parameter
judgeId
inPOST /judges
is now required, - string-type parameter
type
inPOST /judges
method has been replaced with int-typetypeId
parameter; mapping between both parameters is as follows: testcase - 0, master - 1.
Removed
- removed fields
source
,result.runtime_info
fromGET /submissions/:id
method response, - removed fields
result.status_code
(andresult.testcases.status_code
) from submission details (and test cases details) inGET /submissions
andGET /submissions/:id
method responses, - removed deprecated fields
language
,result_score
,result_time
,status
,statusDescription
,result_memory
,result_signal
,result_cmperr
,result_stdout
,result_stderr
,result_psinfo
andresult_array
fromGET /submissions/:id
method response, - removed fields
input
andoutput
fromGET /problems/:code/testcases
method response.