Ideone API
Ideone API
1) © Sphere Research Labs
Ideone API
Documentation
version: 1.1.1
[email protected]
2 Ideone API Documentation (1.1.1) © Sphere Research Labs
Table of Contents
History of changes................................................................................................................................3
1.Introduction........................................................................................................................................4
2.The webservice..................................................................................................................................4
1.General information......................................................................................................................4
2.Functionality.................................................................................................................................4
3.How to use it.................................................................................................................................4
3.Methods.............................................................................................................................................5
1.Common parameters.....................................................................................................................5
2.Returned values.............................................................................................................................5
3.Specification.................................................................................................................................5
4.Variables, values, codes, constants....................................................................................................9
1.Status and result............................................................................................................................9
2.Error codes..................................................................................................................................10
3.Languages...................................................................................................................................10
4.Visibility of a submission...........................................................................................................10
5.Frequently asked questions..............................................................................................................10
3 Ideone API Documentation (1.1.1) © Sphere Research Labs
History of changes
doc author date description
version
1.0.3 Filip Wielewski 19.07.2010 3.1 Common parameters: marked test account
as deprecated and added information about
registration page.
1.0.3 Filip Wielewski 19.07.2010 3.3 Specification: methods createSubmission
and getSubmissionDetails: parameters private
and public respectively: added notices about
the user's visibility.
1.0.3 Filip Wielewski 19.07.2010 4.2 Error codes: added ACCESS_DENIED
error code.
1.0.3 Filip Wielewski 19.07.2010 4.4 Visibility of a submission: created.
1.1.0 Filip Wielewski 01.09.2010 3.1 Removed information about test:test
account which is now disabled.
1.1.1 Filip Wielewski 14.09.2010 4.2 – Error codes: added
CANNOT_SUBMIT_THIS_MONTH_ANYMORE
error code
4 Ideone API Documentation (1.1.1) © Sphere Research Labs
1. Introduction
This document describes ideone.com webservice. It is explained in here how the
methods should be used and how to interpret data returned by them. Terms of use
can be found on ideone.com.
2. The webservice
1. General information
Ideone.com webservice is a standard webservice which can be accessed via
SOAP protocol.
Webservice address: http://ideone.com/api/1/service
WSDL address: http://ideone.com/api/1/service.wsdl
On ideone.com you can also find sample programs written in various
programming languages.
2. Functionality
Ideone API allows to:
◦ upload a source code and share it with everyone on the Internet;
◦ run the code (with input data) on server side in more than 40 programming
languages;
◦ and download results of the execution (output, standard error, compilation
information, execution time, memory usage, etc.).
3. How to use it
The algorithm of creating a paste and executing it on ideone.com server is very
simple:
Of course calling the getSubmissionStatus and getSubmissionsDetails methods
is not obligatory – you can call only createSubmission if all you wish to do is to
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,
which returns the same data every time it is called. It was created for testing
purposes only.
5 Ideone API Documentation (1.1.1) © Sphere Research Labs
3. Methods
1. Common parameters
Each function takes at least 2 parameters:
◦ user – a user name or login,
◦ pass – user's password.
To use Ideone API register at http://ideone.com/account/register and use your own
login and API password.
2. Returned values
Each method returns a specified set of [key, value] pairs as an associative array
where keys are strings and values are of various types:
Key Value type Sample value
error string OK / AUTH_ERROR / ...
key2 someType2 someValue
… … ...
Pair [error, errorCode] is always included in the returned array. If error != OK it
means that something went wrong and that some pairs bound to be returned by
the method may not appear in the array at all.
3. Specification
Method createSubmission
Description Creates a new paste.
Parameters Name Type Description
user string User name.
pass string User's password.
sourceCode string Source code of the paste.
language integer Language identifier. These
identifiers can be retrieved by
using the getLanguages method.
input string Data that will be given to the
program on the stdin.
run boolean Determines whether the source
code should be executed.
private boolean Determines whether the paste
6 Ideone API Documentation (1.1.1) © Sphere Research Labs
Method getSubmissionStatus
Description Returns status and result of a submission.
Parameters Name Type Description
user string User name.
pass string User's password.
link string Language identifier.
Returned values Key Value type Description
error string Error code.
status string Submission's current status
(see: 9).
result string Submission's current result
(see: 9).
Method getSubmissionDetails
Description Returns information about a submission.
Parameters Name Type Description
user string User name.
pass string User's password.
7 Ideone API Documentation (1.1.1) © Sphere Research Labs
parameter will be false.
Method getLanguages
Description Returns a list of supported programming languages.
Parameters Name Type Description
user string User name.
pass string User's password.
Returned values Key Value type Description
error string Error code.
languages array Associative array of [language id,
language name and version] pairs
where key is an integer and value
is a string. Sample pairs:
[1, C++ (gcc4.3.4)]
[29, PHP (php 5.2.11)]
Method testFunction
Description For testing purposes. Returns the same data every time it is called (if
wrong user name or wrong password is provided, then of course it
returns AUTH_ERROR error).
Parameters Name Type Description
user string User name.
pass string User's password.
Returned values Key Value Returned value
type
error string OK / AUTH_ERROR
moreHelp string ideone.com
pi float 3.14
answerToLifeAndEverything integer 42
oOok boolean true
9 Ideone API Documentation (1.1.1) © Sphere Research Labs
4. Variables, values, codes, constants
1. Status and result
Variables status and result returned by the getSubmissionStatus and
getSubmissionDetails methods require further explanation.
Status specifies stage of program's execution. It's values should be interpreted in
the following way:
Value Meaning
< 0 waiting for compilation – the paste awaits
execution in the queue
0 done – the program has finished
1 compilation – the program is being
compiled
3 running – the program is being executed
2. Error codes
Value Meaning
OK Everything went ok.
AUTH_ERROR User name or user's password are invalid.
PASTE_NOT_FOUND Paste with specified link could not be found.
WRONG_LANG_ID Language with specified id does not exist.
ACCESS_DENIED Access to the resource id denied for the
specified user. For example: the submission
has “user's” visibility and can be accessed
only by its author.
CANNOT_SUBMIT_THIS_ You have reached a monthly limit (see
MONTH_ANYMORE http://ideone.com/offer/users for details)
... Other error codes will be added in the future.
3. Languages
Most recent list of supported programming languages is available at
http://ideone.com/faq
4. Visibility of a submission
Visibility determines how a submission is visible on Ideone.com and who can
access it. Possible values are:
◦ public – the submission is visible on the recent page and everyone has
access to it
◦ private – the submission is not listed on the recent page and everyone has
access to it
◦ user's – the submission is not listed on the recent page and only its author
has access to it
Currently only first two values can be set through API.
5. Frequently asked questions
Most recent FAQ can be found at http://ideone.com/faq.