This site hosts the documentation for CrashPlan PROe version 3.8.2010.
Looking for documentation on PROe version 3, released in April of 2012? Please visit our current documentation.

API Architecture

Introduction

The CrashPlan Web Services Interface lets you manipulate a set of resources using a collection of web services built on REST design principles.

One of the way-cool aspects of this type of API is that you can use your browser to download or view the data before you write a script to do it. For example, try this right now with your browser (You will have to enter an admin username and password):

http://<your.proserver.ip.address>:4280/rest/users?status=Active     (downloads all active users)

Sample python scripts are below. If you write a script accessing our API to do something unique, feel free to post an example to our PRO forum to help others to write scripts.

Overview

You can manipulate resources using a set of actions. These actions include most of the standard create, read, update and delete operations as well as a list operation, which supports retrieving all instances of a particular resource. You can constrain this list so that only resources matching specific criteria are returned. For example, a list of all orgs may be constrained to show only those orgs with the name 'Test'.

The framework supports this full set of actions:

  • Create a new resource
  • Retrieve information about a resource
  • Update an existing resource
  • List all instances of a resource

Note that not all actions are supported for all resources; details can be found below.

Mapping Requests onto Actions

An incoming HTTP request corresponds to the application of exactly one action on exactly one resource. The only exception is the list action which operates on an entire class of resources, but even in this case a single request corresponds to a single action. HTTP requests are mapped onto actions using a combination of the HTTP method and the URI:

HTTP method URI Action Request body Response body
GEThttp://localhost:4280/rest/orgs/234Retrieve org with ID of 234NoneDetailed information about org with ID of 234
GEThttp://localhost:4280/rest/orgsList all orgsNoneList of all orgs
POSThttp://localhost:4280/rest/orgsCreate a new orgValues to use when creating the new orgDetailed information about new org; identical to a retrieve operation
PUThttp://localhost:4280/rest/orgs/234Update org 234Values to use when updating org 234Detailed information about updated org; identical to a retrieve operation

As mentioned above, a list operation is constrained to return only resources that match one or more criteria. You can include these constraints as query parameters of the GET request, if desired. For example, changing the sample URL above to http://localhost:4280/rest/org?name=Test returns only orgs with the name “Test”.

Note that not all methods are available for all resources. If a particular resource receives a request using an HTTP method that it does not support, an HTTP type 405 error is returned. The response also includes an “Allow” header that indicates which methods are acceptable for the specified resource.

Data Formats

CrashPlan Web services support sending and receiving data in both XML and JSON formats. There are two headers associated with data format: Accept and Content-Type. The Accept header controls the response format. The Content-Type header tells the server what type of content the client is sending and is required when content is provided.

Content-Type

This header identifies the type of the content contained in an incoming HTTP request. Use of this header is required for requests that contain content, such as a PUT or POST request. The server returns an HTTP type 415 error if a request includes content but excludes the Content-Type header or if the value of the header is not a supported type.

Accept (optional)

The client specifies a response type with the Accept header. If client does not provide the Accept header, the server assumes a response type of JSON. The server returns an HTTP type 406 error if it cannot create a response of the type identified in the header.

Supported Types

Identify types by including a MIME type in one or both of the headers discussed above. The following types (and their corresponding MIME types) are available:

Type Supported MIME type(s) Note
XML text/xml,application/xmlVerbose. Most scripting languages support XML.
JSON application/json Low bandwidth.
PLAINTEXTtext/plain Only supported for a few resources.

Date Values

Date information is always returned as a string value containing the ISO 8601 representation of the underlying date.

Common Properties

All resources contain at least three properties:

  • id = an identifier value unique to a specific instance of a resource
  • creationDate = timestamp recording when a resource was created
  • modificationDate = timestamp recording when a resource was last modified
recipe/api_11_5_2009.txt · Last modified: 2010/03/08 17:27 by mswanson