Welcome
Most applications will use an existing wrapper library in the language of your choice. Over the past several months, we’ve had discussions with customers using LINQ, Microsoft .NET, Python and Java to access our API content.
That said, it’s important to get familiar with the underlying methods used in the API before getting your hands dirty.
For simplicity’s sake, we’ll use cURL for documenting examples, and outputs will be shown in JSON (because it’s less verbose than XML and lends itself more readily to readability) - see response formats for more detailed information on controlling output format.
Let’s start by accessing an information-only API endpoint.
$curl https://api.thousandeyes.com/v5/status
Output
{"timestamp":1383931010006}
This returns the current controller time (in epoch format), if run correctly. This is simply intended for verification that the API is currently running.
Let’s show the response headers, using the -i flag:
$curl -i https://api.thousandeyes.com/v5/status
Output
HTTP/1.1 200 OK
Date: Fri, 08 Nov 2013 17:16:50 GMT
Server: Apache/2.2.22 (Ubuntu)
Transfer-Encoding: chunked
Content-Type: application/json;charset=UTF-8
{"timestamp":1383931010006}
Most of the headers are inconsequential - you’ll see the server’s date and time, version, http status code for your request. When working with our API programmatically, always check to make sure you receive an HTTP/200 response code to your request.
For information on our HTTP status responses, see the response status codes documentation.