API: Getting started
API means Application Programming Interface, but you probably knew that already.
The Combine API allows direct access to the Combine's database from your application program. Not all of it, though, and not right away, it's not that simple.
There are public resources and there are private resources.
"Private" means, you'd access via a specific character's scope. That requires proper authentication, of course, and it's not exactly trivial.
So we'll focus on a few public resources for now, not only to get into the right mood but also because there's quite some nifty stuff available.
You access the API via a directory tree on the SWC website. Root directory is
Yes, give it a try. It won't explode in your face ... I hope. Not often, anyway.
The XML response to this URI is the API's index resource, which also poses as source code for the documentation.
It comes in handy once in a while, but for now you can safely ignore it.
You might think that's an impressive list of features. It is. Unfortunately, a lot of them don't work. But a few very useful ones do.
A first sample
Let's dig a wee bit deeper and try one of the public resources. No, not "hello world", but:
<?xml version="1.0" encoding="UTF-8"?> <timereal xmlns="http://www.swcombine.com/ws/timereal-ns/" version="1.0" timestamp-swc="[swcTime]"> <timestamp-unix>[realTime]</timestamp-unix> </timereal>
There we go.
All API responses follow the same pattern: There is a proper XML header and a root element with a unique name, suitable to identify the resource you're looking at, and a few standard attributes like
- the XML name space
- the API version
- the SWC timestamp
timestamp-swc, when this response was created.
timestamp-swc is SWC's variant of unix time.
You will discover, that you can convert a
timestamp-swc into a regular unix timestamp by adding a constant value of 912668400.
So, whenever you encounter a
timestamp-swc, you'll know what to do.
Okay, that was easy, wasn't it? Now let's try something really useful.