# ArkCase Document Management API documentation

### /api/v1/plugin/ecm

#### /api/v1/plugin/ecm/download/byId/{ecmFileId} get

get

Retrieve the active version of the requested file; for example, if "2.0" is the active version, then version 2.0 is retrieved.

#### get /api/v1/plugin/ecm/download/byId/{ecmFileId}

Retrieve the active version of the requested file; for example, if "2.0" is the active version, then version 2.0 is retrieved.

### URI Parameters

- ecmFileId: required (integer)

  Object ID of the file to be downloaded.

### Query Parameters

- inline (boolean)

  Whether the file should be shown in the browser (true) or downloaded (false)

## HTTP status code 200

Response body is the file content stream. The MIME type is appropriate for the actual file type, and could be any MIME type. If 'inline' was false, the Content-Disposition header is set to "attachment; filename=''" where is the actual file name.

## HTTP status code 500

File could not be downloaded; either such a file does not exist, or the user does not have access to it.

### Body

Type: text/plain

Example:

    The response body will include an error message.

### /api/v1/service/ecm

#### /api/v1/service/ecm/container/{objectType}/{objectId} get

User must be authenticated and must have 'read' access on the object identified by the object type and object id. API doc last verified on 2015-05-11.

get

Get list of all files in the requested container; this could take some time if the container has many files.

#### get /api/v1/service/ecm/container/{objectType}/{objectId}

Get list of all files in the requested container; this could take some time if the container has many files.

### URI Parameters

- objectType: required (string)

  Container type, e.g. COMPLAINT, CASE_FILE, TASK

- objectId: required (integer)

  Container id

## HTTP status code 200

Normal response, object list included.

### Body

Type: application/json

Schema:

    /**
         * Folder List Schema
         */
        {
          "$schema": "http://json-schema.org/draft-04/schema#",
          "title": "Folder List Schema",
          "type": "object",
          "properties": {
            "containerObjectType": {
              "type": "string",
              "description": "Container object type, e.g. COMPLAINT, TASK etc."
            },
            "containerObjectId": {
              "type": "integer",
              "description": "Container object ID",
              "minimum": 1
            },
            "folderId": {
              "type": "integer",
              "description": "Folder ID whose children are included in the children array"
            },
            "totalChildren": {
              "type": "integer",
              "description": "Total number of child objects in this folder; the folder could have more objects than are in the children array"
            },
            "category": {
              "type": "string",
              "description": "What category of objects are included in the children array",
              "enum": [ "Document", "Correspondence", "all" ]
            },
            "sortBy": {
              "type": "string",
              "description": "The requested sort field"
            },
            "sortDirection": {
              "type": "string",
              "description": "The requested sort direction",
              "enum": [ "ASC", "DESC" ]
            },
            "startRow": {
              "type": "integer",
              "description": "Requested start row",
              "minimum": 0
            },
            "maxRows": {
              "type": "integer",
              "description": "Requested number of rows",
              "minimum": 0
            },
            "children": {
              "type": "array",
              "description": "List of the immediate children of the requested folder",
              "uniqueItems": true,
              "minItems": 0,
              "items": {
                "type": "object",
                "properties": {
                  "objectId": {
                    "type": "integer",
                    "description": "Object ID for this object"
                  },
                  "objectType": {
                    "type": "string",
                    "enum": [ "folder", "file" ]
                  },
                  "name": {
                    "type": "string",
                    "description": "object name"
                  },
                  "created": {
                    "type": "string",
                    "description": "create date, in Solr date format"
                  },
                  "modified": {
                    "type": "string",
                    "description": "modified date, in Solr date format"
                  },
                  "creator": {
                    "type": "string"
                  },
                  "modifier": {
                    "type": "string"
                  },
                  "version": {
                    "type": "string",
                    "description": "The primary version tag for this object; only for files, not for folders"
                  },
                  "type": {
                    "type": "string",
                    "description": "The file type, e.g. close_complaint; only for files, not for folders"
                  },
                  "category": {
                    "type": "string",
                    "description": "The kind object; only for files, not for folders",
                    "enum": [ "Document", "Correspondence" ]
                  }
                },
                "required": [ "objectId", "objectType", "name", "created", "modified", "creator", "modifier" ]
              }
            }
          },
          "required": [ "containerObjectType", "containerObjectId", "folderId", "children", "totalChildren", "category", "sortBy", "sortDirection", "startRow", "maxRows" ]
        }

## HTTP status code 403

User is not authorized to read the requested object type

#### /api/v1/service/ecm/copyToAnotherContainer/{targetObjectType}/{targetObjectId} post

post

Copy one or more files to another container. API doc last verified on 2015-05-11.

#### post /api/v1/service/ecm/copyToAnotherContainer/{targetObjectType}/{targetObjectId}

Copy one or more files to another container. API doc last verified on 2015-05-11.

### URI Parameters

- targetObjectType: required (string)

  Object type where the file will be moved to.

- targetObjectId: required (integer)

  ID for the object that will own the new file.

### Body

Type: application/json

Schema:

    {
          "$schema": "http://json-schema.org/draft-04/schema#",
          "title": "ECM Move/Copy File Request Schema",
          "type": "object",
          "properties": {
            "id": {
              "type": "integer",
              "description": "ID of the document to be moved or copied",
              "minimum": 1
            },
            "folderId": {
              "type": "integer",
              "description": "ID of the target folder, where the document will be moved or copied to"
            }
          },
          "required": [ "id", "folderId" ]
        }

Example:

    {
          "id" : 141067,
          "folderId" : 35372
        }

## HTTP status code 200

file copied successfully.

### Body

Type: application/json

Schema:

    /**
         * Copy FileDTO schema
         */
        {
          "$schema": "http://json-schema.org/draft-04/schema#",
          "title": "Copy File DTO Schema",
          "type": "object",
          "properties": {
            "originalId": {
              "type": "string",
              "description": "unique ID for the original ECM file"
            },
            "newFile": {
              "type":"object",
              "properties": {
              "fileId": {
                "type": "integer",
                "description": "unique ID for this ECM file",
                "minimum": 1
              },
              "status": {
                "type": "string",
                "description": "File state, most files will be ACTIVE"
              },
              "created": {
                "type": "string",
                "description": "Date the file was added to the system",
                "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}[+-][0-9]{4}$"
              },
              "creator": {
                "type": "string",
                "description": "User id that created the file; could be a system user"
              },
              "modified": {
                "type": "string",
                "description": "Date the file was last modified",
                "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}[+-][0-9]{4}$"
              },
              "modifier": {
                "type": "string",
                "description": "User id that last updated the file; could be a system user"
              },
              "versionSeriesId": {
                "type": "string",
                "description": "CMIS Object ID representing every version of this file"
              },
              "fileName": {
                "type": "string",
                "description": "The name of the file, e.g. MyFile.docx"
              },
              "fileMimeType": {
                "type": "string",
                "description": "the MIME type of the active version; this convenience property is an alternative to iterating over the fileVersions to find the one with the activeVersionLabel"
              },
              "folder": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer",
                    "description": "unique ID for this folder",
                    "minimum": 1
                  },
                  "creator": {
                    "type": "string",
                    "description": "User id that created the folder; could be a system user"
                  },
                  "modifier": {
                    "type": "string",
                    "description": "User id that last updated the folder; could be a system user"
                  },
                  "created": {
                    "type": "string",
                    "description": "Date the folder was added to the system",
                    "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}[+-][0-9]{4}$"
                  },
                  "modified": {
                    "type": "string",
                    "description": "Date the folder was last modified",
                    "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}[+-][0-9]{4}$"
                  },
                  "cmisFolderId": {
                    "type": "string",
                    "description": "CMIS Folder ID uniquely identifying this folder in the CMIS repository"
                  },
                  "parentFolderId": {
                    "type": "integer",
                    "description": "ID of the parent folder; if null, this folder is a top-level folder and has no parent",
                    "minimum": 1
                  },
                  "name": {
                    "type": "string",
                    "description": "Folder name"
                  }
                }
              },
              "container": {
                "type": "object",
                "properties": {
                  "created": {
                    "type": "string",
                    "description": "Date the file was added to the system",
                    "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}[+-][0-9]{4}$"
                  },
                  "creator": {
                    "type": "string",
                    "description": "User id that created the file; could be a system user"
                  },
                  "modified": {
                    "type": "string",
                    "description": "Date the file was last modified",
                    "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}[+-][0-9]{4}$"
                  },
                  "modifier": {
                    "type": "string",
                    "description": "User id that last updated the file; could be a system user"
                  },
                  "containerObjectType": {
                    "type": "string",
                    "description": "Container type.  Example: CASE_FILE"
                  },
                  "containerObjectId": {
                    "type": "integer",
                    "description": "Container object ID",
                    "minimum": 1
                  },
                  "containerObjectTitle": {
                    "type": "string",
                    "description": "Container object number or title.  Example: 20150204_2961"
                  },
                  "folder": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "integer",
                        "description": "unique ID for this folder",
                        "minimum": 1
                      },
                      "creator": {
                        "type": "string",
                        "description": "User id that created the folder; could be a system user"
                      },
                      "modifier": {
                        "type": "string",
                        "description": "User id that last updated the folder; could be a system user"
                      },
                      "created": {
                        "type": "string",
                        "description": "Date the folder was added to the system",
                        "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}[+-][0-9]{4}$"
                      },
                      "modified": {
                        "type": "string",
                        "description": "Date the folder was last modified",
                        "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}[+-][0-9]{4}$"
                      },
                      "cmisFolderId": {
                        "type": "string",
                        "description": "CMIS Folder ID uniquely identifying this folder in the CMIS repository"
                      },
                      "parentFolderId": {
                        "type": "integer",
                        "description": "ID of the parent folder; if null, this folder is a top-level folder and has no parent",
                        "minimum": 1
                      },
                      "name": {
                        "type": "string",
                        "description": "Folder name"
                      }
                    }
                  }
                }
              },
              "fileType": {
                "type": "string",
                "description": "application-defined file type, e.g. other, roi, report"
              },
              "activeVersionTag": {
                "type": "string",
                "description": "Version tag of the active file version"
              },
              "category": {
                "type": "string",
                "description": "What sort of document this is.  Examples: Document, Correspondence"
              },
              "versions": {
                "description": "List of file versions",
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer",
                      "description": "unique ID for this version",
                      "minimum": 1
                    },
                    "created": {
                      "type": "string",
                      "description": "Date the version was added to the system",
                      "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}[+-][0-9]{4}$"
                    },
                    "creator": {
                      "type": "string",
                      "description": "User id that created the version; could be a system user"
                    },
                    "modified": {
                      "type": "string",
                      "description": "Date the version was last modified",
                      "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}[+-][0-9]{4}$"
                    },
                    "modifier": {
                      "type": "string",
                      "description": "User id that last updated the version; could be a system user"
                    },
                    "cmisObjectId": {
                      "type": "string",
                      "description": "CMIS object id that uniquely identifies this version in the CMIS repository"
                    },
                    "versionTag": {
                      "type": "string",
                      "description": "Version label for tis version"
                    }
                  },
                  "required": [
                    "id",
                    "created",
                    "creator",
                    "modified",
                    "modifier",
                    "cmisObjectId",
                    "versionTag"
                  ]
                },
                "minItems": 1
              },
              "tags": {
                "description": "List of tags applied to this file",
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer",
                      "description": "unique ID for this applied tag",
                      "minimum": 1
                    },
                    "created": {
                      "type": "string",
                      "description": "Date the version was added to the system",
                      "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}[+-][0-9]{4}$"
                    },
                    "creator": {
                      "type": "string",
                      "description": "User id that created the version; could be a system user"
                    },
                    "parentId": {
                      "type": "integer",
                      "description": "ID of the object this tag applies to",
                      "minimum": 1
                    },
                    "parentType": {
                      "type": "string",
                      "description": "Object type of the object this tag applies to.  Example: CASE_FILE"
                    },
                    "tag": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer",
                          "description": "unique ID for this tag",
                          "minimum": 1
                        },
                        "created": {
                          "type": "string",
                          "description": "Date the tag was added to the system",
                          "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}[+-][0-9]{4}$"
                        },
                        "creator": {
                          "type": "string",
                          "description": "User id that created the tag; could be a system user"
                        },
                        "modified": {
                          "type": "string",
                          "description": "Date the tag was last modified",
                          "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}[+-][0-9]{4}$"
                        },
                        "modifier": {
                          "type": "string",
                          "description": "User id that last updated the tag; could be a system user"
                        },
                        "tagText": {
                          "type": "string",
                          "description": "User-visible short tag text"
                        },
                        "tagDescription": {
                          "type": "string",
                          "description": "User-visible longer tag text"
                        },
                        "tagName": {
                          "type": "string",
                          "description": "Tag symbolic name"
                        },
                        "tagToken": {
                          "type": "string",
                          "description": "String representation of the tag, guaranteed to be unique"
                        }
                      }
                    }
                  },
                  "required": [
                    "id",
                    "created",
                    "creator",
                    "modified",
                    "modifier",
                    "tagText"
                  ]
                },
                "minItems": 0
              }
            },
            "required": [
              "fileId",
              "status",
              "created",
              "creator",
              "versionSeriesId",
              "fileName",
              "fileMimeType",
              "folder",
              "container",
              "fileType",
              "activeVersionTag",
              "category",
              "versions",
              "tags"
            ]
          }
          },
          "required": ["originalId","newFile"]
        }

Example:

    {
          "originalId" : "25435",
          "newFile" : {
            "fileId" : 31124,
            "status" : "ACTIVE",
            "created" : "2015-05-27T18:42:31.387-0400",
            "creator" : "ebmillar",
            "modified" : "2015-05-27T18:42:31.387-0400",
            "modifier" : "ebmillar",
            "versionSeriesId" : "workspace://SpacesStore/4bac086d-fab7-4128-a027-00017ac368bc;1.0",
            "fileName" : "Report_of_Investigation_02042015175208434.pdf",
            "fileMimeType" : "application/pdf;frevvo-snapshot=true; charset=utf-8",
            "folder" : {
              "id" : 20164,
              "created" : "2014-11-18T08:09:29.250-0500",
              "creator" : "ebmillar",
              "modified" : "2014-11-18T08:09:29.250-0500",
              "modifier" : "ebmillar",
              "name" : "ROOT",
              "cmisFolderId" : "workspace://SpacesStore/d261b278-54ae-444a-88c3-5665f0c4e8c1",
              "parentFolderId" : null
            },
            "container" : {
              "id" : 15812,
              "created" : "2014-11-18T08:09:29.250-0500",
              "creator" : "ebmillar",
              "modified" : "2014-11-18T08:09:29.250-0500",
              "modifier" : "ebmillar",
              "containerObjectType" : "CASE_FILE",
              "containerObjectId" : 4893,
              "containerObjectTitle" : "20141118_4893",
              "folder" : {
                "id" : 20164,
                "created" : "2014-11-18T08:09:29.250-0500",
                "creator" : "ebmillar",
                "modified" : "2014-11-18T08:09:29.250-0500",
                "modifier" : "ebmillar",
                "name" : "ROOT",
                "cmisFolderId" : "workspace://SpacesStore/d261b278-54ae-444a-88c3-5665f0c4e8c1",
                "parentFolderId" : null
              },
              "calendarFolderId" : null
            },
            "fileType" : "roi",
            "activeVersionTag" : "1.0",
            "category" : "Document",
            "versions" : [{
                "id" : 31125,
                "created" : "2015-05-27T18:42:31.395-0400",
                "creator" : "ebmillar",
                "modified" : "2015-05-27T18:42:31.395-0400",
                "modifier" : "ebmillar",
                "cmisObjectId" : "workspace://SpacesStore/b169cb17-4ccc-41aa-8dbc-96a5aa8a777e;1.0",
                "versionTag" : "1.0"
              }
            ],
            "tags" : []
          }
        }

## HTTP status code 403

User is not authorized to move the file.

## HTTP status code 500

File could not be moved

### Body

Type: text/plain

Example:

    The body will contain an error message.

#### /api/v1/service/ecm/folder/copy/{folderId}/{dstFolderId}/{targetObjectType}/{targetObjectId} post

Copy a folder. API doc last verified on 2015-05-11.

post

Copy a folder to another location, either in the same container or a different container. The folder contents are recursively copied to the other location; this recursive copy operation will take time proportional to the number and size of objects to be copied.

#### post /api/v1/service/ecm/folder/copy/{folderId}/{dstFolderId}/{targetObjectType}/{targetObjectId}

Copy a folder to another location, either in the same container or a different container. The folder contents are recursively copied to the other location; this recursive copy operation will take time proportional to the number and size of objects to be copied.

### URI Parameters

- folderId: required (integer)

  Id of the folder to be copied. This folder must not be a top-level root folder; in other words, this folder's parentFolderId property must not be null.

- dstFolderId: required (integer)

  Id of the target folder

- targetObjectType: required (string)

  Object type of the object that will hold the copied folder

- targetObjectId: required (integer)

  Object ID of the object that will hold the copied folder; the dstFolderId must be a folder owned by this object.

## HTTP status code 200

Folder copied successfully.

### Body

Type: application/json

Schema:

    {
          "$schema": "http://json-schema.org/draft-04/schema#",
          "title": "Copy FolderDTO Schema",
          "type": "object",
          "properties": {
            "originalFolderId": {
              "type": "integer",
              "description": "unique ID for the original folder"
            },
            "newFolder": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer",
                  "description": "unique ID for this folder",
                  "minimum": 1
                },
                "creator": {
                  "type": "string",
                  "description": "User id that created the folder; could be a system user"
                },
                "modifier": {
                  "type": "string",
                  "description": "User id that last updated the folder; could be a system user"
                },
                "created": {
                  "type": "string",
                  "description": "Date the folder was added to the system",
                  "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}[+-][0-9]{4}$"
                },
                "modified": {
                  "type": "string",
                  "description": "Date the folder was last modified",
                  "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}[+-][0-9]{4}$"
                },
                "cmisFolderId": {
                  "type": "string",
                  "description": "CMIS Folder ID uniquely identifying this folder in the CMIS repository"
                },
                "parentFolderId": {
                  "type": "integer",
                  "description": "ID of the parent folder; if null, this folder is a top-level folder and has no parent",
                  "minimum": 1
                },
                "name": {
                  "type": "string",
                  "description": "Folder name"
                }
              },
              "required": ["fileType"]
            }
            },
            "required": [
              "originalFolderId",
              "newFolder"
            ]
        }

Example:

    {
          "originalFolderId":567,
          "newFolder":{
          "id" : 143996,
          "created" : "2015-05-11T15:58:46.527-0400",
          "creator" : "bthomas",
          "modified" : "2015-05-11T15:58:46.527-0400",
          "modifier" : "bthomas",
          "name" : "another test",
          "cmisFolderId" : "workspace://SpacesStore/0f6630d6-f9c1-43b6-87ff-eadcf9b52506",
          "parentFolderId" : 141019
        }
        }

#### /api/v1/service/ecm/folder/{folderId} delete

delete

Deletes the requested folder. The folder must be empty (it must not have any child documents or folders).

#### delete /api/v1/service/ecm/folder/{folderId}

Deletes the requested folder. The folder must be empty (it must not have any child documents or folders).

### URI Parameters

- folderId: required (integer)

  Object ID of the folder to be deleted.

## HTTP status code 200

Delete operation completed; see the response body for whether the folder was actually deleted.

### Body

Type: application/json

Schema:

    {
          "$schema": "http://json-schema.org/draft-04/schema#",
          "title": "Delete Folder Results Schema",
          "type": "object",
          "properties": {
            "message": {
              "type": "string",
              "description": "indicates the results of the delete operation"
            },
            "deletedFolderId": {
              "type": "integer",
              "description": "Object ID of the folder that was deleted",
              "minimum": 1
            }
          },
          "required": [ "message", "deletedFolderId" ]
        }

Example:

    {
          "message" : "Folder with id: 5120 successfully deleted",  // note: it could also say, "Folder with id: 5120 not found in the DB"
          "deletedFolderId" : 5120
        }

## HTTP status code 400

Something went wrong with deleting the folder; most likely the folder was not empty, or else a system error occurred.

### Body

Type: text/plain

Example:

    The body will contain an error message.

#### /api/v1/service/ecm/folder/{folderId}/{newFolderName} post put

post

Rename the requested folder

put

Create a new folder under the requested folder

#### post /api/v1/service/ecm/folder/{folderId}/{newFolderName}

Rename the requested folder

### URI Parameters

- folderId: required (integer)

  Object ID of the folder to be deleted.

- newFolderName: required (string)

#### put /api/v1/service/ecm/folder/{folderId}/{newFolderName}

Create a new folder under the requested folder

### URI Parameters

- folderId: required (integer)

  Object ID of the folder to be deleted.

- newFolderName: required (string)

#### /api/v1/service/ecm/folder/{objectType}/{objectId} get

User must be authenticated and must have 'read' access on the requested object.

get

Get list of objects in the root folder of the requested container.

#### get /api/v1/service/ecm/folder/{objectType}/{objectId}

Get list of objects in the root folder of the requested container.

### URI Parameters

- objectType: required (string)

  Container type, e.g. COMPLAINT, CASE_FILE, TASK

- objectId: required (integer)

  Container id

### Query Parameters

- s one of (author,category,created,creator,modified,modifier,name,type,version)

  Sort order

- dir one of (ASC,DESC)

  Sort direction (ascending or descending)

- start (integer)

  Paging support - the starting row.

- n (integer)

  Paging support - the number of rows

- category one of (Correspondence,Document)

  Used to request only documents, only correspondence, or both; to request both documents and correspondence, do not send a category at all

## HTTP status code 200

Normal response, object list included.

### Body

Type: application/json

Schema:

    /**
         * Folder List Schema
         */
        {
          "$schema": "http://json-schema.org/draft-04/schema#",
          "title": "Folder List Schema",
          "type": "object",
          "properties": {
            "containerObjectType": {
              "type": "string",
              "description": "Container object type, e.g. COMPLAINT, TASK etc."
            },
            "containerObjectId": {
              "type": "integer",
              "description": "Container object ID",
              "minimum": 1
            },
            "folderId": {
              "type": "integer",
              "description": "Folder ID whose children are included in the children array"
            },
            "totalChildren": {
              "type": "integer",
              "description": "Total number of child objects in this folder; the folder could have more objects than are in the children array"
            },
            "category": {
              "type": "string",
              "description": "What category of objects are included in the children array",
              "enum": [ "Document", "Correspondence", "all" ]
            },
            "sortBy": {
              "type": "string",
              "description": "The requested sort field"
            },
            "sortDirection": {
              "type": "string",
              "description": "The requested sort direction",
              "enum": [ "ASC", "DESC" ]
            },
            "startRow": {
              "type": "integer",
              "description": "Requested start row",
              "minimum": 0
            },
            "maxRows": {
              "type": "integer",
              "description": "Requested number of rows",
              "minimum": 0
            },
            "children": {
              "type": "array",
              "description": "List of the immediate children of the requested folder",
              "uniqueItems": true,
              "minItems": 0,
              "items": {
                "type": "object",
                "properties": {
                  "objectId": {
                    "type": "integer",
                    "description": "Object ID for this object"
                  },
                  "objectType": {
                    "type": "string",
                    "enum": [ "folder", "file" ]
                  },
                  "name": {
                    "type": "string",
                    "description": "object name"
                  },
                  "created": {
                    "type": "string",
                    "description": "create date, in Solr date format"
                  },
                  "modified": {
                    "type": "string",
                    "description": "modified date, in Solr date format"
                  },
                  "creator": {
                    "type": "string"
                  },
                  "modifier": {
                    "type": "string"
                  },
                  "version": {
                    "type": "string",
                    "description": "The primary version tag for this object; only for files, not for folders"
                  },
                  "type": {
                    "type": "string",
                    "description": "The file type, e.g. close_complaint; only for files, not for folders"
                  },
                  "category": {
                    "type": "string",
                    "description": "The kind object; only for files, not for folders",
                    "enum": [ "Document", "Correspondence" ]
                  }
                },
                "required": [ "objectId", "objectType", "name", "created", "modified", "creator", "modifier" ]
              }
            }
          },
          "required": [ "containerObjectType", "containerObjectId", "folderId", "children", "totalChildren", "category", "sortBy", "sortDirection", "startRow", "maxRows" ]
        }

## HTTP status code 403

User is not authorized to read the requested object type

#### /api/v1/service/ecm/folder/{parentFolderId}/{newFolderName} put

Create a new folder. API doc last verified on 2015-05-11.

put

Create a new folder under the requested parent folder.

#### put /api/v1/service/ecm/folder/{parentFolderId}/{newFolderName}

Create a new folder under the requested parent folder.

### URI Parameters

- parentFolderId: required (integer)

  Object ID of the parent folder; the new folder will be a subfolder of this folder.

- newFolderName: required (string)

  Name of the new folder.

## HTTP status code 200

Folder was created.

### Body

Type: application/json

Schema:

    {
          "$schema": "http://json-schema.org/draft-04/schema#",
          "title": "ECM Folder Schema",
          "type": "object",
          "properties": {
            "id": {
              "type": "integer",
              "description": "unique ID for this folder",
              "minimum": 1
            },
            "creator": {
              "type": "string",
              "description": "User id that created the folder; could be a system user"
            },
            "modifier": {
              "type": "string",
              "description": "User id that last updated the folder; could be a system user"
            },
            "created": {
              "type": "string",
              "description": "Date the folder was added to the system",
              "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}[+-][0-9]{4}$"
            },
            "modified": {
              "type": "string",
              "description": "Date the folder was last modified",
              "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}[+-][0-9]{4}$"
            },
            "cmisFolderId": {
              "type": "string",
              "description": "CMIS Folder ID uniquely identifying this folder in the CMIS repository"
            },
            "parentFolderId": {
              "type": "integer",
              "description": "ID of the parent folder; if null, this folder is a top-level folder and has no parent",
              "minimum": 1
            },
            "name": {
              "type": "string",
              "description": "Folder name"
            }
          },
          "required": [ "fileType" ]
        }

Example:

    {
          "id" : 143996,
          "created" : "2015-05-11T15:58:46.527-0400",
          "creator" : "bthomas",
          "modified" : "2015-05-11T15:58:46.527-0400",
          "modifier" : "bthomas",
          "name" : "another test",
          "cmisFolderId" : "workspace://SpacesStore/0f6630d6-f9c1-43b6-87ff-eadcf9b52506",
          "parentFolderId" : 141019
        }

#### /api/v1/service/ecm/id/{fileId} delete get

delete

Remove the requested file (both metadata and the content file itself)

get

Get file metadata

#### delete /api/v1/service/ecm/id/{fileId}

Remove the requested file (both metadata and the content file itself)

### URI Parameters

- fileId: required (integer)

  Object ID of the desired file.

## HTTP status code 200

File was deleted.

### Body

Type: application/json

Schema:

    {
          "$schema": "http://json-schema.org/draft-04/schema#",
          "title": "Delete File Results Schema",
          "type": "object",
          "properties": {
            "Message": {
              "type": "string",
              "description": "indicates the results of the delete operation"
            },
            "name": {
              "type": "string",
              "description": "file name of the file that was deleted"
            },
            "deletedFileId": {
              "type": "integer",
              "description": "Object ID of the file that was deleted",
              "minimum": 1
            }
          },
          "required": [ "Message", "deletedFileId" ]
        }

Example:

    {
          "Message" : "File deleted successfully: ",
          "name" : "form_close_complaint_14112014141531007.xml",
          "deletedFileId" : 4478
        }

## HTTP status code 400

File could not be deleted

### Body

Type: text/plain

Example:

    The body will contain an error message.

## HTTP status code 403

User is not authorized to delete the file.

#### get /api/v1/service/ecm/id/{fileId}

Get file metadata

### URI Parameters

- fileId: required (integer)

  Object ID of the desired file.

## HTTP status code 200

File found; metadata is in the response body

### Body

Type: application/json

Schema:

    /**
         * Ecm File Schema
         */
        {
          "$schema": "http://json-schema.org/draft-04/schema#",
          "title": "ECM File Schema",
          "type": "object",
          "properties":
          {
            "fileId": {
              "type": "integer",
              "description": "unique ID for this ECM file",
              "minimum": 1
            },
            "status": {
              "type": "string",
              "description": "File state, most files will be ACTIVE"
            },
            "created": {
              "type": "string",
              "description": "Date the file was added to the system",
              "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}[+-][0-9]{4}$"
            },
            "creator": {
              "type": "string",
              "description": "User id that created the file; could be a system user"
            },
            "modified": {
              "type": "string",
              "description": "Date the file was last modified",
              "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}[+-][0-9]{4}$"
            },
            "modifier": {
              "type": "string",
              "description": "User id that last updated the file; could be a system user"
            },
            "versionSeriesId": {
              "type": "string",
              "description": "CMIS Object ID representing every version of this file"
            },
            "fileName": {
              "type": "string",
              "description": "The name of the file, e.g. MyFile.docx"
            },
            "fileMimeType": {
              "type": "string",
              "description": "the MIME type of the active version; this convenience property is an alternative to iterating over the fileVersions to find the one with the activeVersionLabel"
            },
            "folder": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer",
                  "description": "unique ID for this folder",
                  "minimum": 1
                },
                "creator": {
                  "type": "string",
                  "description": "User id that created the folder; could be a system user"
                },
                "modifier": {
                  "type": "string",
                  "description": "User id that last updated the folder; could be a system user"
                },
                "created": {
                  "type": "string",
                  "description": "Date the folder was added to the system",
                  "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}[+-][0-9]{4}$"
                },
                "modified": {
                  "type": "string",
                  "description": "Date the folder was last modified",
                  "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}[+-][0-9]{4}$"
                },
                "cmisFolderId": {
                  "type": "string",
                  "description": "CMIS Folder ID uniquely identifying this folder in the CMIS repository"
                },
                "parentFolderId": {
                  "type": "integer",
                  "description": "ID of the parent folder; if null, this folder is a top-level folder and has no parent",
                  "minimum": 1
                },
                "name": {
                  "type": "string",
                  "description": "Folder name"
                }
              }
            },
            "container": {
              "type": "object",
              "properties": {
                "created": {
                  "type": "string",
                  "description": "Date the file was added to the system",
                  "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}[+-][0-9]{4}$"
                },
                "creator": {
                  "type": "string",
                  "description": "User id that created the file; could be a system user"
                },
                "modified": {
                  "type": "string",
                  "description": "Date the file was last modified",
                  "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}[+-][0-9]{4}$"
                },
                "modifier": {
                  "type": "string",
                  "description": "User id that last updated the file; could be a system user"
                },
                "containerObjectType":
                {
                  "type": "string",
                  "description": "Container type.  Example: CASE_FILE"
                },
                "containerObjectId":
                {
                  "type": "integer",
                  "description": "Container object ID",
                  "minimum": 1
                },
                "containerObjectTitle":
                {
                  "type": "string",
                  "description": "Container object number or title.  Example: 20150204_2961"
                },
                "folder":
                {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer",
                      "description": "unique ID for this folder",
                      "minimum": 1
                    },
                    "creator": {
                      "type": "string",
                      "description": "User id that created the folder; could be a system user"
                    },
                    "modifier": {
                      "type": "string",
                      "description": "User id that last updated the folder; could be a system user"
                    },
                    "created": {
                      "type": "string",
                      "description": "Date the folder was added to the system",
                      "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}[+-][0-9]{4}$"
                    },
                    "modified": {
                      "type": "string",
                      "description": "Date the folder was last modified",
                      "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}[+-][0-9]{4}$"
                    },
                    "cmisFolderId": {
                      "type": "string",
                      "description": "CMIS Folder ID uniquely identifying this folder in the CMIS repository"
                    },
                    "parentFolderId": {
                      "type": "integer",
                      "description": "ID of the parent folder; if null, this folder is a top-level folder and has no parent",
                      "minimum": 1
                    },
                    "name": {
                      "type": "string",
                      "description": "Folder name"
                    }
                  }
                }
              }
            },
            "fileType": {
              "type": "string",
              "description": "application-defined file type, e.g. other, roi, report"
            },
            "activeVersionTag": {
              "type": "string",
              "description": "Version tag of the active file version"
            },
            "category": {
              "type": "string",
              "description": "What sort of document this is.  Examples: Document, Correspondence"
            },
            "versions": {
              "description": "List of file versions",
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer",
                    "description": "unique ID for this version",
                    "minimum": 1
                  },
                  "created": {
                    "type": "string",
                    "description": "Date the version was added to the system",
                    "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}[+-][0-9]{4}$"
                  },
                  "creator": {
                    "type": "string",
                    "description": "User id that created the version; could be a system user"
                  },
                  "modified": {
                    "type": "string",
                    "description": "Date the version was last modified",
                    "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}[+-][0-9]{4}$"
                  },
                  "modifier": {
                    "type": "string",
                    "description": "User id that last updated the version; could be a system user"
                  },
                  "cmisObjectId": {
                    "type": "string",
                    "description": "CMIS object id that uniquely identifies this version in the CMIS repository"
                  },
                  "versionTag": {
                    "type": "string",
                    "description": "Version label for tis version"
                  }
                },
                "required": [ "id", "created", "creator", "modified", "modifier", "cmisObjectId", "versionTag" ]
              },
              "minItems": 1
            },
            "tags": {
              "description": "List of tags applied to this file",
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer",
                    "description": "unique ID for this applied tag",
                    "minimum": 1
                  },
                  "created": {
                    "type": "string",
                    "description": "Date the version was added to the system",
                    "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}[+-][0-9]{4}$"
                  },
                  "creator": {
                    "type": "string",
                    "description": "User id that created the version; could be a system user"
                  },
                  "parentId": {
                    "type": "integer",
                    "description": "ID of the object this tag applies to",
                    "minimum": 1
                  },
                  "parentType": {
                    "type": "string",
                    "description": "Object type of the object this tag applies to.  Example: CASE_FILE"
                  },
                  "tag": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "integer",
                        "description": "unique ID for this tag",
                        "minimum": 1
                      },
                      "created": {
                        "type": "string",
                        "description": "Date the tag was added to the system",
                        "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}[+-][0-9]{4}$"
                      },
                      "creator": {
                        "type": "string",
                        "description": "User id that created the tag; could be a system user"
                      },
                      "modified": {
                        "type": "string",
                        "description": "Date the tag was last modified",
                        "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}[+-][0-9]{4}$"
                      },
                      "modifier": {
                        "type": "string",
                        "description": "User id that last updated the tag; could be a system user"
                      },
                      "tagText": {
                        "type": "string",
                        "description": "User-visible short tag text"
                      },
                      "tagDescription": {
                        "type": "string",
                        "description": "User-visible longer tag text"
                      },
                      "tagName": {
                        "type": "string",
                        "description": "Tag symbolic name"
                      },
                      "tagToken": {
                        "type": "string",
                        "description": "String representation of the tag, guaranteed to be unique"
                      }
                    }
                  }
                },
                "required": [ "id", "created", "creator", "modified", "modifier", "tagText" ]
              },
              "minItems": 0
            }
          },
          "required": [ "fileId", "status", "created", "creator", "versionSeriesId", "fileName", "fileMimeType", "folder", "container", "fileType", "activeVersionTag", "category", "versions", "tags" ]
        }

Example:

    {
          "fileId" : 143997,
          "status" : "ACTIVE",
          "created" : "2015-05-11T16:54:32.580-0400",
          "creator" : "bthomas",
          "modified" : "2015-05-11T16:54:32.580-0400",
          "modifier" : "bthomas",
          "versionSeriesId" : "workspace://SpacesStore/31268e01-b428-4c1d-b829-d4b27ee3bdfc;1.0",
          "fileName" : "acmDocumentWorkflow.bpmn20_29042015093459926.xml",
          "fileMimeType" : "text/xml",
          "folder" : {
            "id" : 35372,
            "created" : "2015-02-04T15:50:11.957-0500",
            "creator" : "sally-acm",
            "modified" : "2015-02-04T15:50:11.957-0500",
            "modifier" : "sally-acm",
            "name" : "ROOT",
            "cmisFolderId" : "workspace://SpacesStore/ee3542a2-166f-4796-8802-1fdfb190c4ed",
            "parentFolderId" : null
          },
          "container" : {
            "id" : 33953,
            "created" : "2015-02-04T15:50:11.957-0500",
            "creator" : "sally-acm",
            "modified" : "2015-02-04T15:50:11.957-0500",
            "modifier" : "sally-acm",
            "containerObjectType" : "CASE_FILE",
            "containerObjectId" : 2961,
            "containerObjectTitle" : "20150204_2961",
            "folder" : {
              "id" : 35372,
              "created" : "2015-02-04T15:50:11.957-0500",
              "creator" : "sally-acm",
              "modified" : "2015-02-04T15:50:11.957-0500",
              "modifier" : "sally-acm",
              "name" : "ROOT",
              "cmisFolderId" : "workspace://SpacesStore/ee3542a2-166f-4796-8802-1fdfb190c4ed",
              "parentFolderId" : null
            }
          },
          "fileType" : "ot",
          "activeVersionTag" : "1.0",
          "category" : "Document",
          "versions" : [{
              "id" : 143998,
              "created" : "2015-05-11T16:54:32.605-0400",
              "creator" : "bthomas",
              "modified" : "2015-05-11T16:54:32.605-0400",
              "modifier" : "bthomas",
              "cmisObjectId" : "workspace://SpacesStore/580f615a-0745-49f1-873c-b7f58c5b1a2f;1.0",
              "versionTag" : "1.0"
            }
          ],
          "tags" : []
        }

## HTTP status code 400

File could not be deleted

### Body

Type: text/plain

Example:

    The body will contain an error message.

## HTTP status code 403

User is not authorized to delete the file.

#### /api/v1/service/ecm/moveToAnotherContainer post

post

Move one or more files to another container

#### post /api/v1/service/ecm/moveToAnotherContainer

Move one or more files to another container

#### /api/v1/service/ecm/moveWithinContainer post

post

Move one or more files to an existing folder in the same container

#### post /api/v1/service/ecm/moveWithinContainer

Move one or more files to an existing folder in the same container

#### /api/v1/service/ecm/upload post

post

Add a file. User must have "add file" permission on the parent object. File name must be unique in the folder where the file is added. If the parentCmisFolderId is provided, that folder must be within the parent object's folder tree.

#### post /api/v1/service/ecm/upload

Add a file. User must have "add file" permission on the parent object. File name must be unique in the folder where the file is added. If the parentCmisFolderId is provided, that folder must be within the parent object's folder tree.

### Body

Type: multipart/form-data

Form Parameters

- file: required (file)

  Files to be added; file parts can have any name, so long as the MIME type indicates it is a file. All files in the request will be added to the system.

- category: one of (Document,Correspondence)

  What kind of file is being uploaded.

- fileType: required (string)

  The logical file type ("other", "roi", ...); not the MIME type.

  Example:

      other, roi, case_file

- parentObjectType: required (string)

  Type tag for the parent object

  Example:

      CASE_FILE, COMPLAINT, TASK

- parentObjectId: required (integer)

  Object ID for the parent object

- parentFolderId: (string)

  Database object ID for the folder to contain the uploaded file. If given, the folder must be within the parent object's folder tree; otherwise an exception is thrown. The uploaded file will be placed in the requested folder. If not given, the folder will be placed in the parent object's root folder.

## HTTP status code 200

File successfully added. Body is an array of EcmFile objects.

### Body

Type: application/json

Schema:

    {
          "$schema": "http://json-schema.org/draft-04/schema#",
          "title": "Array of files",
          "type": "array",
          "items": {
            "type": "object",
            "properties":
            {
              "id": {
                "type": "integer",
                "description": "unique ID for this ECM file",
                "minimum": 1
              },
              "cmisVersionSeriesLabel": {
                "type": "string",
                "description": "CMIS Object ID representing every version of this file"
              },
              "activeVersionLabel": {
                "type": "string",
                "description": "Version tag of the active file version"
              },
              "fileType": {
                "type": "string",
                "description": "application-defined file type, e.g. other, roi, report"
              },
              "mimeType": {
                "type": "string",
                "description": "the MIME type of the active version; this convenience property is an alternative to iterating over the fileVersions to find the one with the activeVersionLabel"
              },
              "fileName": {
                "type": "string",
                "description": "The name of the file, e.g. MyFile.docx"
              },
              "status": {
                "type": "string",
                "description": "File state, most files will be ACTIVE"
              },
              "participants": {
                "description": "List of file participants",
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "creator": {
                "type": "string",
                "description": "User id that created the file; could be a system user"
              },
              "modifier": {
                "type": "string",
                "description": "User id that last updated the file; could be a system user"
              },
              "created": {
                "type": "string",
                "description": "Date the file was added to the system",
                "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$"
              },
              "modified": {
                "type": "string",
                "description": "Date the file was last modified",
                "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$"
              },
              "objectType": {
                "type": "string",
                "description": "Object type for this object - the constant value FILE",
                "pattern": "^FILE$"
              },
              "fileVersions": {
                "description": "List of file versions",
                "type": "array",
                "items": {
                  "type": "object"
                },
                "minItems": 1
              }
            },
            "required": [ "fileType" ]
          }
        }

## HTTP status code 403

User is not authorized to add a file to the container object.

#### /api/v1/service/ecm/upload/{fileId} post

post

Add a new file version. User must have "version file" permission for the requested file.

#### post /api/v1/service/ecm/upload/{fileId}

Add a new file version. User must have "version file" permission for the requested file.

### URI Parameters

- fileId: required (integer)

  ID of the file to be versioned

### Body

Type: multipart/form-data

Form Parameters

- file: required (file)

  The file to be added

#### /api/v1/service/ecm/versionHistory/{fileId} get

get

Get the version history for one file

#### get /api/v1/service/ecm/versionHistory/{fileId}

Get the version history for one file

### URI Parameters

- fileId: required (string)