General usage

The API is accessible at the same location as your Subversion Edge console.

For example, if you access your console at http://host.mycompany.com:3343/csvn, the API URL would look like http://host.mycompany.com:3343/csvn/api/1/repository/34, where "1" indicates the API version number, "repository" indicates the entity you are working with, and "34" indicates the ID of the instance. In this documentation, such URLs are shown as absolute paths (/csvn/api/1/repository without the host, port number and so on.

Request format

Requests to the API are directed to a URL indicating the entity and use one of the following HTTP methods (verbs) to indicate the action: A request body is required for PUT or POST operations. It can contain XML or JSON data for parameters, or file content for certain posting operations such as uploading a zipped repository as a template. The Content-Type header indicates the format of the body. Response format is indicated with a format URL parameter, in the Accept header, or as a pseudo extension to the entity or instance (for example, /csvn/api/1/repository/34.json). Here is an example POST request in JSON and XML formats:

Authentication

The API requires basic HTTP authentication for all services except Secure Port. In a web browser, you can provide this authentication using the authentication dialog box or in the user-information section of the URL. You can also supply an Authorization header in the request, where the value for the header is "Basic {md5 hash of username:password}".

Response format

The API responds in XML or JSON format depending on the request type, and uses HTTP status codes to indicate success or failure. The most important status codes are as follows:
200 OK (for successful GET requests)
201 Entity created or updated successfully (for successful PUT, POST or DELETE)
400 Bad request (parameters incorrect or missing in the URL or request body)
401 Unauthorized
404 Not found
405 Method not implemented (for example, POST is not supported for this entity type)
Here is an example response in JSON and XML formats: