API Reference
Overview
The Webscale API is a fully RESTful HTTP-based API. The standard HTTP methods (e.g., GET
, PUT
, POST
, and DELETE)
are supported. The API only responds over HTTPS. Responses are returned in the JSON
format. Currently only a small subset of the Webscale API’s are public, please feel free to contact us if you need an API that is not available.
Generate an access key
An access key is required for authentication. Use the following steps to generate the access key.
- Log in to your Webscale control panel.
- Click the user icon on the upper right, then click the Access Keys tab. From here, click the Create new Access Key button.
- On the box that opens, choose whether the access key should expire or not. If you do want it to expire, click the toggle and then choose an expiry date from the calendar. Then click Create Access Key.
- The View Access Key dialog is now displayed. Click Show Key, then click Copy Key to copy the key to your clipboard.
Warning
Save this somewhere secure! If you lose it you will have to delete this access key and generate a new one. - To delete the access key, click the trashcan icon.
Calling the API
The API only responds over HTTPS.
Resources and resource collections are identified by paths:
/app/{app_id}/logs
Query parameters can be used to further qualify the resource:
/app/{app_id}/logs?start_time=2015-07-31T00:00:00
Resources are operated upon using standard HTTP verbs:
GET /app/{app_id}/logs?start_time=2015-07-31T00:00:00
API URL
https://api.webscale.com/v2/
The resource path and query parameters are appended to the API URL to construct the complete resource URI. For example, the URI for the collection of application logs occurring after July 31st 2015 is:
https://api.webscale.com/v2//app/{app_id}/logs?start_time=2015-07-31T00:00:00
Response
All responses are returned in the JSON
format. In the example below we request all the logs for example-app
occurring after July 31st 2015. The response is a URL where the requested application logs can be downloaded.
Request:
GET https://api.webscale.com/v2//app/example-app/logs?start_time=2015-07-31T00:00:00
Response:
{
"download_url": "https://api.webscale.com/download/xON7989HUOY800slnay2a90"
}
Authentication
Authentication is performed by sending an access token as either a query parameter or in an Authorization request header. Every API request must be authorized.
Authorization query parameter
The access token can be sent via the authorization query parameter. If the access token is sent via the authorization query parameter then an Authorization request header must not be sent.
https://api.webscale.com/v2/resource?authorization=mF9B5f41JqMz8zdfQ
Authorization request header
When sending the access token in the Authorization request header field defined by HTTP/1.1 (RFC2617), the client uses the Bearer authentication scheme to transmit the access token. If the access token is sent via the Authorization request header then an authorization query parameter must not be sent.
GET /v2/resource HTTP/1.1
Host: api.webscale.com
Authorization: Bearer mF9B5f41JqMz8zdfQ
Active access token
You may provide an access token in the field below to be included in all API calls as a bearer token via the Authorization request header field. If you leave this field blank then you will need to provide the access token with each API request as a query parameter.