You are on page 1of 11

1 1

IdeoneAPISpecification(1.1.3)SphereResearchLabs

IdeoneAPI
Specification

version:1.1.3

contact@ideone.com

IdeoneAPIispoweredbySphereEngine


2 1
IdeoneAPISpecification(1.1.3)SphereResearchLabs

TableofContents

Historyofchanges................................................................................................................................3
1.Introduction........................................................................................................................................4
2.Thewebservice..................................................................................................................................4
1.Generalinformation......................................................................................................................4
2.Functionality.................................................................................................................................4
3.Howtouseit.................................................................................................................................4
3.Methods.............................................................................................................................................5
1.Commonparameters.....................................................................................................................5
2.Returnedvalues.............................................................................................................................5
3.Specification.................................................................................................................................5
4.Variables,values,codes,constants....................................................................................................9
1.Statusandresult............................................................................................................................9
2.Errorcodes..................................................................................................................................10
3.Languages...................................................................................................................................10
4.Visibilityofasubmission...........................................................................................................10
5.Frequentlyaskedquestions..............................................................................................................11

IdeoneAPIispoweredbySphereEngine


3 1
IdeoneAPISpecification(1.1.3)SphereResearchLabs

Historyofchanges
doc author date description
version
1.0.3 FilipWielewski 19.07.2010 Marked test account as deprecated and added
informationaboutregistrationpage.
1.0.3 FilipWielewski 19.07.2010 Methods createSubmission and getSubmissionDetails:
parametersprivateandpublicrespectively:addednotices
abouttheuser'svisibility.
1.0.3 FilipWielewski 19.07.2010 Errorcodes:addedACCESS_DENIEDerrorcode.
1.0.3 FilipWielewski 19.07.2010 Visibilityofacodechaptercreated.
1.1.0 FilipWielewski 01.09.2010 Removedinformationabouttest:testaccountwhichisnow
disabled.
1.1.1 FilipWielewski 14.09.2010 Errorcodes:added
CANNOT_SUBMIT_THIS_MONTH_ANYMOREerrorcode.
1.1.2 FilipWielewski 26.01.2011 The webservice > Methods > Common parameters:
AddednoticeaboutIdeoneAPIpassword.
1.1.3 FilipWielewski 01.09.2013 Visibility of a submission: names of values changed:
privatetosecret,user'stoprivate.

IdeoneAPIispoweredbySphereEngine


4 1
IdeoneAPISpecification(1.1.3)SphereResearchLabs

1. Introduction
Thisdocumentdescribesideone.comwebservice.Itisexplainedinherehowthemethodsshouldbe
usedandhowtointerpretdatareturnedbythem.

2. Thewebservice

1. Generalinformation
Ideone.comwebserviceisastandardwebservicewhichcanbeaccessedviaSOAPprotocol.
Webserviceaddress:http://ideone.com/api/1/service
WSDLaddress:http://ideone.com/api/1/service.wsdl
At http://ideone.com/samples you can find sample programs written in various programming
languages.

IdeoneAPIispoweredbySphereEngine

.Visitwww.sphereengine.comformoreinformation.

2. Functionality
IdeoneAPIallowsyouto:
uploadasourcecodeandshareitwitheveryoneontheInternet;
runtheprogramwithinputdataonserversideinmorethan60programminglanguages;
and download results of the execution (output, standard error, compilation information,
executiontime,memoryusage,etc.).

3. Howtouseit
Thealgorithmofcreatingasubmissionandexecutingitonideone.comisverysimple:

1. RetrievealistofavailableprogramminglanguagesusingthegetLanguagesmethod.
2. CreateasubmissionusingthecreateSubmissionmethod.
3. Use getSubmissionStatus to check whether ideone.com has finished executing the
program.Iftheprogramhasfinished,proceedtostepno.4.Otherwisewait35seconds
andrepeatstepno.3.
4. Use getSubmissionDetails to retrieve detailed information about the execution of the
program.
5. Gotostepno.2toexecuteanotherprogramordonothingmore.

OfcoursecallingthegetSubmissionStatusandgetSubmissionsDetailsmethodsisnotobligatory
youcancallonlycreateSubmissionifallyouwishtodoistoplaceasourcecodeonideone.com.
Sinceidentifiersofthelanguagesarepermanentandtheyneverchange,youdon'tevenhaveto
callthegetLanguagesmethod.IdeoneAPIprovidesonemoremethod:testFunction,whichreturns
thesamedataeverytimeitiscalled.Itwascreatedfortestingpurposesonly.

IdeoneAPIispoweredbySphereEngine


5 1
IdeoneAPISpecification(1.1.3)SphereResearchLabs

3. Methods

1. Commonparameters
Eachfunctiontakesatleast2parameters:
userausernameorlogin,
passuser'spassword.

TouseIdeoneAPIregisterathttp://ideone.com/account/registeranduseyourownloginand
APIpassword.Pleasenote:APIpasswordisn'tthesameasyouraccountpasswordandmustbe
setseparatelyduringregistrationorathttp://ideone.com/account/.

2. Returnedvalues
Eachmethodreturnsaspecifiedsetof[key,value]pairsasanassociativearraywherekeysare
stringsandvaluesareofvarioustypes:
Key Valuetype Samplevalue
error string OK/AUTH_ERROR/...
key2 someType2 someValue
...
Pair [error, errorCode] is always included in the returned array. If error != OK it means that
somethingwentwrongandthatsomepairsboundtobereturnedbythemethodmaynotappearin
thearrayatall.

3. Specification

Method createSubmission
Description Createsanewsubmission.
Parameters Name Type Description
user string Username.
pass string User'spassword.
sourceCode string Sourcecodeofthesubmission.
language integer Language identifier. Language identifiers
can be retrieved by using the
getLanguagesmethod.
input string Datathatwillbegiventotheprogramon
stdin.

IdeoneAPIispoweredbySphereEngine


6 1
IdeoneAPISpecification(1.1.3)SphereResearchLabs

run boolean Determines whether the source code


shouldbeexecuted.
private boolean Determines whether the submission
should be public or secret. Secret
submissionsdonotappearonthe recent
codes pageonideone.com.Pleasenote:
youcanonlysetsubmission'svisibilityto
publicor secret throughAPI(youcannot
settheprivatevisibility).
Returnedvalues Key Valuetype Description
error string Errorcode.
link string Identifierofthesubmission.Thisidentifier
shouldbeusedtorefertothesubmission
whencallingothermethods.Itcanalsobe
usedtoaccessthesubmissionon
ideone.com;forexample:ifthelinkis
abcdefthenthesubmissionwillbe
availableathttp://ideone.com/abcdef

Method getSubmissionStatus
Description Returnsstatusandresultofasubmission.
Parameters Name Type Description
user string Username.
pass string User'spassword.
link string Languageidentifier.
Returnedvalues Key Valuetype Description
error string Errorcode.
status string Submission'scurrentstatus
(see:9).
result string Submission'scurrentresult
(see:9).

Method getSubmissionDetails
Description Returnsinformationaboutasubmission.
Parameters Name Type Description

IdeoneAPIispoweredbySphereEngine


7 1
IdeoneAPISpecification(1.1.3)SphereResearchLabs

user string Username.


pass string User'spassword.
link string Languageidentifier.
withSource boolean Determines whether source code of the
submissionshouldbereturned.
withInput boolean Determines whether input data of the
submissionshouldbereturned.
withOutput boolean Determines whether output produced by
theprogramshouldbereturned.
withStderr boolean Determines whether stderr should be
returned.
withCmpinfo boolean Determines whether compilation
informationshouldbereturned.
Returnedvalues Key Valuetype Description
error string Errorcode.
langId integer Submission'slanguageidentifier.
langName string Submission's language name. For
example:C++
langVersion string Submission's language version. For
example:gcc4.3.4
time float Executiontimeinseconds.
date string Server date and time of submission's
creationinthefollowingformat:
YYYYMMDDHHMMSS;
forexample:
20090519023456
status integer Submission'scurrentstatus.
(see:9).
result integer Submission'scurrentresult.
(see:9).
memory integer Memoryusedbytheprogram.
signal integer Signal raised by the program when an
errorhadoccurred.
public boolean Determines whether the submission is
public. Public submissions are listed on
the recent codes page on ideone.com.
Pleasenote:ifthesubmissionhassecret

IdeoneAPIispoweredbySphereEngine


8 1
IdeoneAPISpecification(1.1.3)SphereResearchLabs

visibilitythisparameterwillbefalse.
source string Sourcecodeofthesubmission.Thisvalue
isreturnedifthe withSource parameteris
settotrue.
input string Inputdataofthesubmission.Thisvalueis
returnedifthe withInput parameterisset
totrue.
output string Output produced by the program. This
value is returned if the withOutput
parameterissettotrue.
stderr string Stderr produced by the program. This
value is returned if the withStderr
parameterissettotrue.
cmpinfo string Compilation information regarding the
program. This value is returned if the
withCmpinfoparameterissettotrue.

Method getLanguages
Description Returnsalistofsupportedprogramminglanguages.
Parameters Name Type Description
user string Username.
pass string User'spassword.
Returnedvalues Key Valuetype Description
error string Errorcode.
languages array Associative array of [language id,
languagenameandversion]pairswhere
key is an integer and value is a string.
Samplepairs:
[1,C++(gcc4.3.4)]
[29,PHP(php5.2.11)]

Method testFunction
Description Fortestingpurposes.Returnsthesamedataeverytimeitiscalled(ifwronguser
nameorwrongpasswordisprovided,thenAUTH_ERRORerrorcodeisreturned).
Parameters Name Type Description

IdeoneAPIispoweredbySphereEngine


9 1
IdeoneAPISpecification(1.1.3)SphereResearchLabs

user string Username.


pass string User'spassword.
Returnedvalues Key Valuetype Returnedvalue
error string OK/AUTH_ERROR
moreHelp string ideone.com
pi float 3.14
answerToLifeAndEverything integer 42
oOok boolean true

4. Variables,values,codes,constants

1. Statusandresult
Variables status and result returned by the getSubmissionStatus and getSubmissionDetails
methodsrequirefurtherexplanation.
Status specifiesstageofprogram'sexecution.It'svaluesshouldbeinterpretedinthefollowing
way:
Value Meaning
<0 waitingforcompilationthesubmissionawaits
executioninthequeue
0 donetheprogramhasfinished
1 compilationtheprogramisbeingcompiled
3 runningtheprogramisbeingexecuted

WhenyouusethegetSubmissionStatusmethodandstatusisnotequalto0thenyoushouldwait
35secondsandcallthemethodagain.
Whenthesubmission'sstatusis0youcanfindouthowtheprogramhasfinishedbycheckingthe
resultvariable.
Value Meaning
0 notrunningthesubmissionhasbeencreatedwith
runparametersettofalse
11 compilation error the program could not be
executedduetocompilationerror
12 runtimeerrortheprogramfinishedbecauseofthe
runtimeerror,forexample:divisionbyzero, array
indexoutofbounds,uncaughtexception

IdeoneAPIispoweredbySphereEngine


10 1
IdeoneAPISpecification(1.1.3)SphereResearchLabs

13 timelimitexceededtheprogramdidn'tstopbefore
thetimelimit
15 successeverythingwentok
17 memorylimitexceededtheprogramtriedtouse
morememorythanitisallowedto
19 illegalsystemcalltheprogramtriedtocallillegal
systemfunction
20 internal error some problem occurred on
ideone.com;trytosubmittheprogramagainandif
that fails too, then please contact us at
contact@ideone.com

2. Errorcodes
Value Meaning
OK Everythingwentok.
AUTH_ERROR Usernameoruser'spasswordareinvalid.
PASTE_NOT_FOUND Submissionwithaspecifiedlinkcouldnotbefound.
WRONG_LANG_ID Languagewithaspecifiediddoesnotexist.
ACCESS_DENIED Accesstotheresourceisdeniedforthespecifieduser.
For example: the submission has private visibility and
canbeaccessedonlybyitsauthor.
CANNOT_SUBMIT_THIS_MON You have reached a monthly limit (see
TH_ANYMORE http://ideone.com/offer/usersfordetails)
... Othererrorcodeswillbeaddedinthefuture.

3. Languages
Most recent list of supported programming languages is available at
http://ideone.com/faq#supportedlanguages

4. Visibilityofasubmission
Visibilitydetermineshowaprogramisvisibleonideone.comandwhocanaccessit.Possible
valuesare:
publiceveryonehasaccesstothecodeanditislistedattherecentcodespage
secreteveryonehasaccesstothecodeanditisnotlistedattherecentcodespage;
privateonlyauthorofthecodehasaccesstoitanditisnotlistedattherecentcodespage.
Tousethislevelofvisibilityyouneedtobeloggedin.

IdeoneAPIispoweredbySphereEngine


11 1
IdeoneAPISpecification(1.1.3)SphereResearchLabs

CurrentlyonlyfirsttwovaluescanbesetthroughAPI.

5. Frequentlyaskedquestions
MostrecentFAQcanbefoundathttp://ideone.com/faq.

IdeoneAPIispoweredbySphereEngine

You might also like