Current Version: 3.1 (2012-01-23)
The Linode API is a programmatic interface into many of the Linode Manager's features. The API has been expanded to include not only DNS Manager functions, but also Linode creation, control, and deletion.
To use the Linode API you must have a Linode account. The API follows the existing Users and Permissions system, so a user can only perform the operations and actions on instances they have access to. You can create users, restrict permissions, and use their API keys as necessary.
To make your life easier several really awesome people have collaborated and contributed implementations of the Linode API in various languages, so you don't have to.
If you have any questions about the API, these bindings, or would like to have your project listed here, please send an email to api@linode.com.
All requests require an API key, with one exception: User.GetAPIKey() can be used to acquire or generate a user's API key through the API itself. API keys can be regenerated on the user's My Profile page at any time.
You can pass in the API key one of two ways: either using HTTP Basic Authentication passing in the key as the password, or by
sending an api_key request parameter via GET or POST.
https://u:abc123@api.linode.com/ # HTTP Basic Authentication
https://api.linode.com/?api_key=abc123 # Passing via GET variable
There is no authentication method preference, so use the one you're most comfortable with.
The api_action parameter is required on every request.
All API request parameters and method parameters can be sent via either GET or POST variables.
https://api.linode.com/?api_key=abc123&api_action=test.echo&foo=bar
NOTE: api.linode.com responds only via https://api.linode.com.
The optional parameter api_responseFormat can be set to either "json", "wddx" or "human". The default is to output responses in JSON format.
JSON, or JavaScript Object Notation, is a simple, efficient, and easy to use data object serialization method supported in many languages.
WDDX, or Web Distributed Data eXchange, is an alternative to JSON, with the data being encoded within XML.
An api_responseFormat set to "human" will produce output that's easily visually parsed by humans, but not so easy for programs.
This is convenient for testing and debugging.
{
"ERRORARRAY":[],
"ACTION":"test.echo",
"DATA":{
"FOO":"bar"
}
}
<wddxPacket version='1.0'> <header/> <data> <struct> <var name='ERRORARRAY'><array length='0'></array></var> <var name='ACTION'><string>test.echo</string></var> <var name='DATA'> <struct><var name='FOO'><string>bar</string></var></struct> </var> </struct> </data> </wddxPacket>
Above are example JSON and WDDX responses.
The Linode API also supports a batched mode, whereby you supply multiple request sets encoded in JSON or WDDX, and receive back an array of responses.
To perform a batch request simply set api_action=batch and place all of your requests in the api_requestArray parameter.
https://api.linode.com/?api_key=abc123&api_action=batch&
api_requestArray=[{"api_action": "test.echo", "foo": "bar"},
{"api_action": "test.echo", "ying": "yang"}]
[
{
"ERRORARRAY":[],
"ACTION":"test.echo",
"DATA":{"foo":"bar"}
},
{
"ERRORARRAY":[],
"ACTION":"test.echo",
"DATA":{"ying":"yang"}
}
]
Above is an example batch request and the resulting response.
ErrorCodes that can be returned by any method.
0: ok