Professional Documents
Culture Documents
IdeoneAPIDocumentation(1.1.2)SphereResearchLabs
1
IdeoneAPI
Documentation
version:1.1.2
contact@ideone.com
IdeoneAPIDocumentation(1.1.2)SphereResearchLabs
1
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..............................................................................................................10
IdeoneAPIDocumentation(1.1.2)SphereResearchLabs
1
Historyofchanges
doc
version
author
date
description
1.0.3 FilipWielewski
19.07.2010
3.1Commonparameters:markedtestaccount
as deprecated and added information about
registrationpage.
1.0.3 FilipWielewski
19.07.2010
3.3Specification:methods createSubmission
and getSubmissionDetails: parameters private
and public respectively: added notices about
theuser'svisibility.
1.0.3 FilipWielewski
19.07.2010
1.0.3 FilipWielewski
19.07.2010
4.4Visibilityofasubmission:created.
1.1.0 FilipWielewski
01.09.2010
1.1.1 FilipWielewski
14.09.2010
4.2Errorcodes:added
CANNOT_SUBMIT_THIS_MONTH_ANYMORE
errorcode.
1.1.2 FilipWielewski
26.01.2011
3.1AddednoticeaboutAPIpassword.
IdeoneAPIDocumentation(1.1.2)SphereResearchLabs
1
1. Introduction
Thisdocumentdescribesideone.comwebservice.Itisexplainedinherehowthe
methodsshouldbeusedandhowtointerpretdatareturnedbythem.Termsofuse
canbefoundonideone.com.
2. Thewebservice
1.
Generalinformation
Ideone.comwebserviceisastandardwebservicewhichcanbeaccessedvia
SOAPprotocol.
Webserviceaddress:http://ideone.com/api/1/service
WSDLaddress:http://ideone.com/api/1/service.wsdl
On ideone.com you can also find sample programs written in various
programminglanguages.
2.
Functionality
IdeoneAPIallowsto:
uploadasourcecodeandshareitwitheveryoneontheInternet;
runthecode(withinputdata)onserversideinmorethan40programming
languages;
anddownloadresultsoftheexecution(output,standarderror,compilation
information,executiontime,memoryusage,etc.).
3.
Howtouseit
Thealgorithmofcreatingapasteandexecutingitonideone.comserverisvery
simple:
1. Retrieve a list of available programming languages using the
getLanguagesmethod.
2. CreateapasteusingthecreateSubmissionmethod.
3. Use getSubmissionStatus to check whether ideone.com has finished
executingtheprogram.Iftheprogramhasfinished,proceedtothestep
no.4.Otherwisewait35secondsandrepeatstepno.3.
4. Use getSubmissionDetails to retrieve detailed information about the
executionoftheprogram.
5. Gotothestepno.2toexecuteanotherprogramordonothingmore.
OfcoursecallingthegetSubmissionStatusandgetSubmissionsDetailsmethods
isnotobligatoryyoucancallonlycreateSubmissionifallyouwishtodoisto
place a source code on ideone.com. Since identifiers of the languages are
permanent and they never change, you don't even have to call the
getLanguages method. Ideone API provides one more method: testFunction,
whichreturnsthesamedataeverytimeitiscalled.Itwascreatedfortesting
purposesonly.
IdeoneAPIDocumentation(1.1.2)SphereResearchLabs
1
3. Methods
1.
Commonparameters
Eachfunctiontakesatleast2parameters:
userausernameorlogin,
passuser'spassword.
TouseIdeoneAPIregisterathttp://ideone.com/account/registeranduseyourown
loginandAPIpassword.Notice:APIpasswordisn'tthesameasyouraccount
passwordandmustbesetseparatelyduringregistrationorat
http://ideone.com/account/.
2.
Returnedvalues
Eachmethodreturnsaspecifiedsetof[key,value]pairsasanassociativearray
wherekeysarestringsandvaluesareofvarioustypes:
Key
Valuetype
Samplevalue
error
string
OK/AUTH_ERROR/...
key2
someType2
someValue
...
Pair[error,errorCode]isalwaysincludedinthereturnedarray.Iferror!=OKit
meansthatsomethingwentwrongandthatsomepairsboundtobereturnedby
themethodmaynotappearinthearrayatall.
3.
Specification
Method
createSubmission
Description
Createsanewpaste.
Parameters
Name
Type
Description
user
string
Username.
pass
string
User'spassword.
sourceCode
string
Sourcecodeofthepaste.
language
integer
input
string
run
boolean
IdeoneAPIDocumentation(1.1.2)SphereResearchLabs
1
codeshouldbeexecuted.
Returnedvalues
private
boolean
Key
Valuetype
Description
error
string
Errorcode.
link
string
Pasteidentifier.Thisidentifier
oughtbeusedtorefertothepaste
whencallingothermethods.Itcan
alsobeusedtoaccessthepaste
onideone.com;forexample:if
thelinkwerea1b2c3d4thenthe
pastewouldbeavailableat
http://ideone.com/a1b2c3d4
Method
getSubmissionStatus
Description
Returnsstatusandresultofasubmission.
Parameters
Name
Type
Description
user
string
Username.
pass
string
User'spassword.
link
string
Languageidentifier.
Key
Valuetype
Description
error
string
Errorcode.
status
string
Submission'scurrentstatus
(see:9).
result
string
Submission'scurrentresult
(see:9).
Returnedvalues
Method
getSubmissionDetails
Description
Returnsinformationaboutasubmission.
Parameters
Name
Type
Description
user
string
Username.
IdeoneAPIDocumentation(1.1.2)SphereResearchLabs
1
Returnedvalues
pass
string
User'spassword.
link
string
Languageidentifier.
withSource
boolean
withInput
boolean
Determineswhetherinputdata of
the submission should be
returned.
withOutput
boolean
withStderr
boolean
Determineswhetherstderrshould
bereturned.
withCmpinfo
boolean
Key
Valuetype
Description
error
string
Errorcode.
langId
integer
Submission'slanguageidentifier.
langName
string
Submission'slanguagename.For
example:C++
langVersion
string
time
float
Executiontimeinseconds.
date
string
status
integer
Submission'scurrentstatus.
(see:9).
result
integer
Submission'scurrentresult.
(see:9).
memory
integer
Memoryusedbytheprogram.
signal
integer
Signalraisedbytheprogramwhen
anerrorhadoccurred.
public
boolean
IdeoneAPIDocumentation(1.1.2)SphereResearchLabs
1
Method
getLanguages
Description
Returnsalistofsupportedprogramminglanguages.
Parameters
Name
Type
Description
user
string
Username.
pass
string
User'spassword.
Key
Valuetype
Description
error
string
Errorcode.
languages
array
Returnedvalues
Method
testFunction
Description
Fortestingpurposes.Returnsthesamedataeverytimeitiscalled(if
wrongusernameorwrongpasswordisprovided,thenofcourseit
returnsAUTH_ERRORerror).
Parameters
Name
Type
Description
user
string
Username.
pass
string
User'spassword.
Key
Value
type
Returnedvalue
error
string
OK/AUTH_ERROR
moreHelp
string
ideone.com
pi
float
3.14
answerToLifeAndEverything
integer
42
oOok
boolean
true
Returnedvalues
IdeoneAPIDocumentation(1.1.2)SphereResearchLabs
1
4. Variables,values,codes,constants
1.
Statusandresult
Variables status and result returned by the getSubmissionStatus and
getSubmissionDetailsmethodsrequirefurtherexplanation.
Statusspecifiesstageofprogram'sexecution.It'svaluesshouldbeinterpretedin
thefollowingway:
Value
Meaning
<0
waitingforcompilationthepasteawaits
executioninthequeue
donetheprogramhasfinished
compilationtheprogramisbeing
compiled
runningtheprogramisbeingexecuted
Meaning
notrunningthepastehasbeencreated
withrunparametersettofalse
11
compilationerrortheprogramcouldnot
beexecutedduetocompilationerrors
12
13
15
successeverythingwentok
17
memorylimitexceededtheprogramtried
tousemorememorythanitisallowed
19
illegalsystemcalltheprogramtriedtocall
illegalsystemfunction
20
internalerrorsomeproblemoccurredon
ideone.com;trytosubmitthepasteagain
andifthatfailstoo,thenpleasecontactus
10
IdeoneAPIDocumentation(1.1.2)SphereResearchLabs
1
atcontact@ideone.com
2.
Errorcodes
Value
Meaning
OK
Everythingwentok.
AUTH_ERROR
Usernameoruser'spasswordareinvalid.
PASTE_NOT_FOUND
Pastewithspecifiedlinkcouldnotbefound.
WRONG_LANG_ID
Languagewithspecifiediddoesnotexist.
ACCESS_DENIED
3.
Othererrorcodeswillbeaddedinthefuture.
Languages
Most recent list of supported programming languages is available at
http://ideone.com/faq
4.
Visibilityofasubmission
VisibilitydetermineshowasubmissionisvisibleonIdeone.comandwhocan
accessit.Possiblevaluesare:
public the submission is visible on the recent page and everyone has
accesstoit
privatethesubmissionisnotlistedontherecentpageandeveryonehas
accesstoit
user'sthesubmissionisnotlistedontherecentpageandonlyitsauthor
hasaccesstoit
CurrentlyonlyfirsttwovaluescanbesetthroughAPI.
5. Frequentlyaskedquestions
MostrecentFAQcanbefoundathttp://ideone.com/faq.