Files
Files collection
Binary files that are attachments to other objects, Test, TestList, Comment, etc...
GET /Files GET files metadata.

Parameters

/Files?includeDeleted={includeDeleted}
includeDeleted [Boolean]
Boolean indicating wheter to fetch deleted files. Defaults to true.

Returns

200 OK. The response body contains an array of file metatada objects.
Example:
{
    "_id": "9c25f2d9-bcc0-41b0-877d-0a380d1e5a96",
    "LastUpdate": "2013-06-13T20:24:13.48",
    "Metadata": {
        "Deleted": false,
        "LastUpdate": "2013-06-13T20:24:13.48",
        "LastUpdatedBy": "storageservice",
        "ContentId": ""
    }
}
GET /Files/{id} GET a file by id.

Parameters

/Files/{id}?includeDeleted={includeDeleted}
id [String] required
file unique identifier
includeDeleted [Boolean]
Boolean indicating wheter to fetch deleted files. Defaults to true.

Returns

200 OK. The response is multipart/mixed containing the file requested. A custom Metadata header cotains the file's metadata.
Example Metadata header:
Metadata: 
{
    "Deleted": false,
    "LastUpdate": "2013-06-13T20:24:13.48",
    "LastUpdatedBy": "storageservice",
    "ContentId": ""
}
POST /Files Adds a file to the files collection
Expects a file in the request body and the appropriate Content-Type header.

Parameters

/Files?name={name}
name [String]
Name of the file being created.

Returns

201 Created. The custom Added header contains the updated file metadata.
Example Added custom header:
    
Added: 
{
    "Id": "516e8725-3c0e-4f6b-8b98-d5507429d609",
    "Metadata": {
        "Name": null,
        "ParentId": null,
        "LastUpdate": "2013-06-17T15:00:18.336Z",
        "LastUpdatedBy": "storageservice",
        "Schema": "",
        "Deleted": false,
        "AttachmentIds": null,
        "Tag": null
    },
    "Data": null
}
HTTP Status
Reason
200
OK. Added header will contain metadata for updated file.
400
Bad Request: name parameter is not supplied.
400
Bad Requst: Request body does not contain a file.
PUT /Files/{id} Update an existing file
Expects a file in the body of request.

Parameters

/Files/{id}?lastUpdate={lastUpdate}
id [String] required
id of file to update
lastUpdate [String] required
timestamp of last update for this file.
Dates are stored in UTC and should be in ISO-8601 format(yyyy-MM-ddTHH:mmm:ssss.fffZ)

Returns

201 Created. The custom Added header contains the updated file metadata.
Example Added custom header:
    
Added:
{
    "Id": "516e8725-3c0e-4f6b-8b98-d5507429d609",
    "Metadata": {
        "Name": null,
        "ParentId": null,
        "LastUpdate": "2013-06-17T15:00:18.336Z",
        "LastUpdatedBy": "storageservice",
        "Schema": "",
        "Deleted": false,
        "AttachmentIds": null,
        "Tag": null
    },
    "Data": null
}
HTTP Status
Reason
201
Created. Added header will contain metadata for updated file.
400
Bad Request: id parameter is not supplied.
400
Bad Request: lastUpdate is not in the correct date format. All dates must be UTC in ISO-8601 format (yyyy-MM-ddTHH:mmm:ssss.fffZ).
400
Bad Request: lastUpdate parameter is not supplied.
400
Bad Requst: Content-Type header media type does not match request content.
400
Bad Requst: Content-Type header not set.
400
Bad Requst: Request body does not contain a file.
409
Conflict: file has been previously deleted.
409
Conflict: lastUpdate does not match file's last updated timestamp.
DELETE /Files/{id} Remove a file from the files collection.
Note: this does not perform a hard delete. The file is tombstoned in the collection.

Parameters

/Files/{id}?lastUpdate={lastUpdate}
id [String] required
identifier of the file to remove.
lastUpdate [String] required
timestamp of last update for the file.
Dates are stored in UTC and should be in ISO-8601 format(yyyy-MM-ddTHH:mmm:ssss.fffZ)

Returns

200 OK
HTTP Status
Reason
200
OK
400
Bad Request: id parameter is not supplied.
400
Bad Request: lastUpdate is not in the correct date format. All dates must be UTC in ISO-8601 format (yyyy-MM-ddTHH:mmm:ssss.fffZ).
400
Bad Request: lastUpdate parameter is not supplied.
409
Conflict: file has been previously deleted.
409
Conflict: lastUpdate does not match file's last updated timestamp.