- 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 /compilersmethod response, - added new field
executingto the submission details inGET /submissions/:idandGET /submissionsmethods responses, - added new field
result.streamsto the submission details inGET /submissions/:idmethod response, - added new field
urito the submission details inGET /submissionsmethod response, - added new parameters
compilerVersionId,filestoPOST /submissionsmethod.
Changed
- unified naming standard for data streams (
stdin->input,stdout->output,stderr->error,cmperr->cmpinfo,psinfo->debug) in various methods, - modified structure of
GET /compilersmethod response, - significant changes in the structure of
GET /submissions/:idandGET /submissionsmethods responses, - data that is not yet available to be retrieved is presently shown as
nullin 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 cases0was returned).
Removed
- removed submission streams data (i.e., source, input, output, error, cmpinfo, debug) from the
GET /submissions/:idmethod response; this change eliminates potential issues with binary data in streams, - removed default values for
compilerIdandsourceparameters fromPOST /submissions; both parameters are now required.
Compilers API
Added
- added support for output-files (see output files),
- added new parameters
timeLimit,memoryLimittoPOST /submissionsmethod.
Changed
- api endpoint is now
{customer_key}.compilers.sphere-engine.cominstead of its former versionfor consistency with Problems API,{customer_key}.api.compilers.sphere-engine.com - modified structure of
GET /testmethod response to be consistent with the same method in Problems API, - format of date in
GET /submissions/:idandGET /submissionsmethods responses is nowYYYY-MM-DD hh:mm:ss +Zinstead ofYYYY-MM-DD hh:mm:ss(i.e., information about time zone is added), - integer-type field
statusin submission details inGET /submissionsandGET /submissions/:idmethods responses has been replaced with complex-type structure with two fields, i.e.,result.status.codeandresult.status.name, - values from field
resultare merged with values fromstatusfield in submission details inGET /submissionsandGET /submissions/:idmethods responses; the merged value is stored in fieldresult.status.code.
Removed
- removed field
errorfrom responses of all methods, - removed deprecated
GET /languagesthat was redundant due to existence ofGET /compilersmethod, - removed deprecated field
langId,langName,langVersion,publicandcompiler.verin submission details inGET /submission/:idandGET /submissionsmethods responses, - removed field
output_typefromGET /submission/:idmethod response, - removed field
resultfromGET /submission/:idmethod response in its former interpretation; currently, presentresultfield aggregates all data generated during runtime of the program, - removed parameters
withSource,withInput,withOutput,withStderrandwithCmpinfofromGET /submission/:idmethod, - removed deprecated
sourceCodeandcompilerparameters fromPOST /submissionsmethod.
Problems API
Added
- added method
GET /submissions/:id/:streamfor retrieving data from submission streams (i.e., source, output, error, cmpinfo, debug), - added optional parameter
teststo methodPOST /submissions; this parameter allows selecting of test cases for which a submission will be tested, - added new field
idtoPOST /problemsmethod response, - added new field
idto problem details inGET /problemsandGET /problems/:idmethods responses, - added method
DELETE /problems/:idfor removing programming problems, - added new field
urito the test case details inGET /problems/:code/testcasesmethod response, - added new field
datatoGET /problems/:code/testcases/:numbermethod response, - added new field
visibilityto judge details inGET /judgesandGET /judges/:idmethods responses, - added new field
compiler.versiontoGET /judges/:idmethod response, - added method
GET /judges/:id/:filenamefor retrieving judge files, - added new parameter
sharedtoPOST /judgesmethod response, - added new parameter
sharedtoPUT /judgesmethod 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
statusin submission details (and test cases details) inGET /submissionsandGET /submissions/:idmethods responses has been replaced with a complex-type structure with two fields, i.e.,result.status.codeandresult.status.name(andresult.testcases[].status.code,result.testcases[].status.name), - many fields in API responses now have proper type (e.g.,
result.testcases[].numberis now integer, not string), - significant changes in the structure of
GET /problems/:idandGET /problemsmethods responses, - string-type parameter
typeinPOST /problemsmethod has been replaced with int-typetypeIdparameter; mapping between both parameters is as follows: binary - 0, minimize - 1, maximize - 2, - parameter
masterjudgeIdinPOST /problemmethod is now required, - fields
paging.nextandpaging.prevare always present in response forGET /problemsandGET /judgesmethods; if there is no previous or next page, then the value of the respective field is equal tonull, - field
shortBodyis always present in problem details inGET /problemsandGET /problems/:idmethods responses; if the content of theshortBodyfield was not demanded, then its value is equal tonull, - field
actionsin problem details inGET /problemsandGET /problems/:idmethods responses has been renamed topermissions, - fields
lastModifedBodyandlastModifiedSettingsin problem details inGET /problemsandGET /problems/:idmethods responses are reorganized to belastModified.bodyandlastModified.settingsrespectively, - string-type field
typeinGET /problems/:idmethod response has been extended to complex-type structure with two fields, i.e.,type.idandtype.name, - parameter
judgeIdinPOST /problems/:id/testcasesis now required, - parameter
timelimitinPOST /problems/:id/testcasesmethod has been renamed totimeLimit, - field
testcasesinGET /problems/:code/testcasesmethod response has been renamed toitemsfor consistency with other methods returning collections, - fields
inputandoutputinGET /problems/:code/testcases/:numbermethod response are now fields of newly addeddatafield; therefore, these fields are now accessible asdata.inputanddata.outputrespectively, - string-type field
typein judge details inGET /judgesandGET /judges/:idmethods responses has been extended to a complex-type structure with two fields, i.e.,type.idandtype.name, - string-type field
typeinGET /judges/:idmethod response has been reorganized to a complex-type structure with two fields, i.e.,source.sizeandsource.uri, - parameter
judgeIdinPOST /judgesis now required, - string-type parameter
typeinPOST /judgesmethod has been replaced with int-typetypeIdparameter; mapping between both parameters is as follows: testcase - 0, master - 1.
Removed
- removed fields
source,result.runtime_infofromGET /submissions/:idmethod response, - removed fields
result.status_code(andresult.testcases.status_code) from submission details (and test cases details) inGET /submissionsandGET /submissions/:idmethod responses, - removed deprecated fields
language,result_score,result_time,status,statusDescription,result_memory,result_signal,result_cmperr,result_stdout,result_stderr,result_psinfoandresult_arrayfromGET /submissions/:idmethod response, - removed fields
inputandoutputfromGET /problems/:code/testcasesmethod response.