You are on page 1of 10

1

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

4.2 Error codes: added ACCESS_DENIED


errorcode.

1.0.3 FilipWielewski

19.07.2010

4.4Visibilityofasubmission:created.

1.1.0 FilipWielewski

01.09.2010

3.1 Removed information about test:test


accountwhichisnowdisabled.

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

Language identifier. These


identifiers can be retrieved by
usingthegetLanguagesmethod.

input

string

Data that will be given to the


programonthestdin.

run

boolean

Determines whether the source

IdeoneAPIDocumentation(1.1.2)SphereResearchLabs
1

codeshouldbeexecuted.

Returnedvalues

private

boolean

Determines whether the paste


should be private. Private pastes
do not appear on the recent
pastes page on ideone.com.
Notice: you can only set
submission's visibility to public or
private through the API (you
cannotsettheuser'svisibility).

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

Determines whether source code


of the submission should be
returned.

withInput

boolean

Determineswhetherinputdata of
the submission should be
returned.

withOutput

boolean

Determines whether output


produced by the program should
bereturned.

withStderr

boolean

Determineswhetherstderrshould
bereturned.

withCmpinfo

boolean

Determines whether compilation


informationshouldbereturned.

Key

Valuetype

Description

error

string

Errorcode.

langId

integer

Submission'slanguageidentifier.

langName

string

Submission'slanguagename.For
example:C++

langVersion

string

Submission's language version.


Forexample:gcc4.3.4

time

float

Executiontimeinseconds.

date

string

Server date and time of


submission's creation in the
followingformat:
YYYYMMDDHHMMSS;
forexample:
20090519023456

status

integer

Submission'scurrentstatus.
(see:9).

result

integer

Submission'scurrentresult.
(see:9).

memory

integer

Memoryusedbytheprogram.

signal

integer

Signalraisedbytheprogramwhen
anerrorhadoccurred.

public

boolean

Determines whether the paste is


public.Publicpastesarelistedon
the recent pastes page on

IdeoneAPIDocumentation(1.1.2)SphereResearchLabs
1

ideone.com. Notice: if the


submissionhasuser'svisibilitythis
parameterwillbefalse.

Method

getLanguages

Description

Returnsalistofsupportedprogramminglanguages.

Parameters

Name

Type

Description

user

string

Username.

pass

string

User'spassword.

Key

Valuetype

Description

error

string

Errorcode.

languages

array

Associative array of [language id,


languagenameandversion]pairs
wherekeyisanintegerandvalue
isastring.Samplepairs:
[1,C++(gcc4.3.4)]
[29,PHP(php5.2.11)]

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

WhenyouusethegetSubmissionStatusmethodand status isnotequalto0


thenyoushouldwait35secondsandcallthemethodagain.
Whenthepaste'sstatusis0youcanfindouthowtheprogramhasfinishedby
checkingtheresultvariable.
Value

Meaning

notrunningthepastehasbeencreated
withrunparametersettofalse

11

compilationerrortheprogramcouldnot
beexecutedduetocompilationerrors

12

runtime error the program finished


becauseoftheruntimeerror,forexample:
divisionbyzero,arrayindexoutofbounds,
uncaughtexception

13

time limit exceeded the program didn't


stopbeforethetimelimit

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

Access to the resource id denied for the


specified user. For example: the submission
has user's visibility and can be accessed
onlybyitsauthor.

CANNOT_SUBMIT_THIS_ You have reached a monthly limit (see


MONTH_ANYMORE
http://ideone.com/offer/usersfordetails)
...

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.

You might also like