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/v7/status.json
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/v7/status.json
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.
HTTP/1.1 200 OK
Date: Wed, 19 Apr 2017 13:01:09 GMT
For information on our HTTP status responses, see the response status codes documentation.