Using the REST API
The CloudHub REST API provides a way for you to programmatically access much of CloudHub's functionality. It allows you to:
- Create applications
- Change application properties, including the number of workers and environment variables
- Deploy a new version of your application
- Delete your application
- Get statistics about your application
Before getting started with specific operations, be sure you're familiar with Operations for Applications.
All resources or methods that return or accept a type use the JSON as the data format. As an example, here's data you might receive, in JSON format, in response to a request to get an application:
Getting Started and Authenticating with the API
All APIs require HTTP basic authentication using your CloudHub username and password.
Status Codes and Error Handling
When you call the REST APIs, the following status codes are returned:
The operation was successful.
The resource (such as, application) was created. The Location header will contain the location of the resource.
The resource was not found.
When creating a resource (such as, server, server group, or deployment), a resource with that name already exists.
The operation was unsuccessful. See the HTTP body for details.
When errors occur (for example, a 500 status code), the HTTP response contains a JSON response with an error message. For example: