References (v1)
OVERVIEW
Versioning 0 comments →
If you call our API without specifying which version you want, then you will automatically use the latest version. But you will also have the option to use our older code as well.
There are two different ways to choose which version of our API that you wish to use. You can either add the version to the url as shown below (versions with decimals are separated by hyphens):
curl --user EMAIL:API_KEY https://wwws.appfirst.com/api/v1/servers/
curl --user EMAIL:API_KEY https://wwws.appfirst.com/api/v2-1/buckets/25/data/
Or you can specify the version in the accept part in the header of the request. You must specify application/json with the version number appended to it delimited by a semicolon as shown below:
Accept: application/json;1
Response code 0 comments →
These are the response codes that our API's return.
| Code | Translation |
|---|---|
| 200 | Success! |
| 400 | Bad Request. Either the request type is wrong or the arguments are wrong or missing. A response will be provided with details. |
| 401 | Unauthorized. The api key and email you gave us do not match. |
| 404 | Not Found. The url does not exist on this server. |
| 500 | Internal Server Error. Our fault. |
| 503 | Service Unavailable. You have reached your limit for the day. |
Authentication 0 comments →
All our APIs, unless otherwise specified, require basic authentication. The username is the email of the account owner and the password is the api key which you can find under Administration -> APIs. For example, to get the list of servers running on your system you would do something like:
curl --user EMAIL:API_KEY https://wwws.appfirst.com/api/servers/
You can do this by taking the string "EMAIL:API_KEY" or "EMAIL:YOUR_PASSWORD" and encoding it with standard base 64 encoding. Set this string in the header of the request as the value of the key HTTP_AUTHENTICATION.
Encoding 0 comments →
When your calling an API that takes data, be sure to urlencode it first before uploading. For PUT and POST requests, you will need to also be sure to set the CONTENT_TYPE header to application/x-www-form-urlencoded.
When parameters specify themselves as a json encoded string, that means you must first serialize the data to json and then urlencode it.
All dates are represented as a number of seconds (integer) since the epoch of January 1st, 1970.
