Loading...
 
Introducing the Webride API
Foreword
Prior to accessing the Webride API, please contact us, say hello and tell us what you aim to do, so we can prepare ourselves to serve the bandwidth and traffic needs, your application may produce. Furthermore, we may be helpful by adding new features or optimizing the API for your specific purposes.


Request syntax
The API is entirely REST-based, with every request URI following this syntax:


To dissect this, we have http://webride.org/api/rest.php, followed by two mandatory parameters
  • p ( = package)
  • m ( = method)
We have split the API into currently 8 packages with a total of 26 methods to read or write data. We will document most of them within the next weeks and months. Following the mandatory p and m parameters, there may be additional mandatory or optional parameters, specific to the chosen package/method combination.


Return values
What the API returns as an answer to your request, basically looks like this:


We have a surrounding webride element, containing a status element (OK or FAIL), along with the portion that interests us most, the data element, which can contain more XML or just a simple text string like the "pong" you see in the example above.


Error handling
Whenever the API returns status code FAIL, look for contained substatus elements and their code attribute:


There may be more than just one substatus, so be sure to handle them all.


JSON
If JSON better suites your demands, just add an additional json parameter to your request like this:


As a result, you will get the JavaScript-ified version of the XML you saw in our example ("Return values") above:


Skip over to David Sklar's BadgerFish project page to learn about the JSON dialect that we use.


Get started
Now that you have got a first insight into the API, go over to the Package section to learn about the packages and their methods. If you think something is missing in this short intro or should be explained in a more understandable way, please comment on this page.