Process File Manager Endpoints

The following are the methods currently implemented for the process file manager resources of the designer in the ProcessMaker API.

Process File Manager resources:

NameDescriptionType Value
prj_uidProject UIDStringString of 32 characters
prf_uidFile UIDStringString of 32 characters
prf_pathPath nameString"public/.../..." or "templates/.../..."
pathPath nameString"public/.../..." or "templates/.../..."
prf_filenameFile nameStringString
contentFile contentStringString
usr_uidUID of the user who created the documentStringString
prg_update_usr_uidUID of the user who updated the documentStringString
prf_typeRegistry typeStringString. It can be a file or folder.
prf_editableIndicates if the registry is editableStringString
prf_create_dateDocument creation dateDateDate
prf_update_dateDocument update dateDateDate
prf_contentDocument contentStringString
prf_derivation_screenReturns "true" if the template is used as a routing screen of a task or process. Otherwise, returns "false".Stringtrue|false

Get Files List: GET project/{prj_uid}/file-manager?path={path}

Gets a list of the files in a project.

GET /api/1.0/{workspace}/project/{prj_uid}/file-manager?path={path}

Function: doGetProcessFileManager()

Parameters:

NameTypeDescription
workspaceStringWorkspace name
prj_uidStringProject UID

Optional Parameter:

NameTypeDescription
pathStringFile path. For example: "templates" to retrieve only the process's templates.

Result:

TypeDescription
array Returns an array of objects containing information about the files

Example:

Response

 {path}
 // public -> 'public'
 // templates -> file alias 'mainTemplates'

 200 (OK)
 [
    {
        "name": "templates",
        "type": "folder",
        "path": "/",
        "editable": false
    },
    {
        "name": "public",
        "type": "folder",
        "path": "/",
        "editable": false
    }
 ]

 // For sub files E.g. 'public/directory_1/.../directory_n'
 200(OK)
 [
    {
        "prf_name": "test",
        "prf_type": "folder",
        "prf_path": "templates"
    },
    {
        "prf_uid": "906750465531e05b994e711084668227",
        "prf_filename": "test.txt",
        "usr_uid": "00000000000000000000000000000001",
        "prf_update_usr_uid": "",
        "prf_path": "templates/",
        "prf_type": "file",
        "prf_editable": "true",
        "prf_create_date": "2014-03-10 14:34:33",
        "prf_update_date": null,
        "prf_content": "fsdfsdgsdgsd",
        "prf_derivation_screen": false
    },
    {
        "prf_uid": "376806779533adc6f96be58025995587",
        "prf_filename": "alert_message.html",
        "usr_uid": "00000000000000000000000000000001",
        "prf_update_usr_uid": "",
        "prf_path": "templates/",
        "prf_type": "file",
        "prf_editable": "false",
        "prf_create_date": "2014-04-01 11:34:07",
        "prf_update_date": null,
        "prf_content": "",
        "prf_derivation_screen": true
    }
 ]

Create file: POST project/{prj_uid}/file-manager

Creates a file in the File Manager.

Permission:

Users must have the PM_FACTORY permission assigned to their role to perform this action.

Structure:

POST /api/1.0/{workspace}/project/{prj_uid}/file-manager
Function: doPostProcessFilesManager()

Parameters:

NameTypeDescription
workspaceStringWorkspace name
prj_uidStringProject UID

Required Fields:

NameTypeDescription
prf_pathStringPath name
prf_filenameStringFile name
contentStringFile content

Result:

TypeDescription
objectReturns an object containing information about the new file.

Example:

Request

 Content-Type: application/json
 {
    "prf_filename": "file.html",
    "prf_path": "public/carpeta_1",
    "prf_content": "document content"
 }

Response

 201 (Created)
 {
    "prf_uid": "10135107353961aff6201c8069655112",
    "prf_filename": "file.html",
    "usr_uid": "00000000000000000000000000000001",
    "prf_update_usr_uid": "",
    "prf_path": "public/carpeta_1/",
    "prf_type": "file",
    "prf_editable": false,
    "prf_create_date": "2014-06-09 16:37:19",
    "prf_update_date": null,
    "prf_content": "contenido del documento"
 }

Update the File Content: PUT project/{prj_uid}/file-manager/{prf_uid}

Permission:

Users must have the PM_FACTORY permission assigned to their role to perform this action.

Structure:

PUT /api/1.0/{workspace}/project/{prj_uid}/file-manager/{prf_uid}
Function: (doPutProcessFileManager)

Parameters:

NameTypeDescription
workspaceStringWorkspace name
prj_uidStringProject UID
prf_uidStringFile UID

Required Fields:

NameTypeDescription
contentStringFile content

Result:

TypeDescription
object Returns an object containing information about the file

Example:

Request

 Content-Type: application/json
 {
    "prf_content": "modify content"
 }

Response

 200 (OK)
 {
    "prf_uid": "7164627665397061c79d806082862933",
    "prf_filename": "file2.html",
    "usr_uid": "00000000000000000000000000000001",
    "prf_update_usr_uid": "",
    "prf_path": "public/carpeta_1/",
    "prf_type": "file",
    "prf_editable": false,
    "prf_create_date": "2014-06-10 09:20:28",
    "prf_update_date": null,
    "prf_content": "contenido del documento"
 }

Upload a Document: POST project/{prj_uid}/file-manager/{prf_uid}/upload

Uploads a document to the File Manager.

Permission:

Users must have the PM_FACTORY permission assigned to their role to perform this action.

Structure:

POST /api/1.0/{workspace}/project/{prj_uid}/file-manager/{prf_uid}/upload
Function: (doPostProcessFilesManagerUpload)

Parameters:

NameTypeDescription
workspaceStringWorkspace name
prj_uidStringProject UID
prf_uidStringFile UID

Result:

TypeDescription
emptyNo return

Example:

Response

 201 (Created)

Download a Document: GET project/{prj_uid}/file-manager/{prf_uid}/download

Downloads a document.

GET /api/1.0/{workspace}/project/{prj_uid}/file-manager/{prf_uid}/download
Function: (doGetProcessFilesManagerDownload)

Parameters:

NameTypeDescription
workspaceStringWorkspace name
prj_uidStringProject UID
prf_uidStringFile UID

Result:

TypeDescription
emptyNo return

Example:

Response

  200(OK)

Delete a Document of a File: DELETE project/{prj_uid}/file-manager/{prf_uid}

Deletes a document from the file manager.

Permission:

Users must have the PM_FACTORY permission assigned to their role to perform this action.

Structure:

DELETE /api/1.0/{workspace}/project/{prj_uid}/file-manager/{prf_uid}
Function: (doDeleteProcessFilesManager)

Parameters:

NameTypeDescription
workspaceStringWorkspace name
prj_uidStringProject UID
prf_uidStringFile UID

Result:

TypeDescription
emptyNo return

Example:

Response

  200(OK)

Delete a File from the Project: DELETE project/{prj_uid}/file-manager/folder?path={path}

Deletes the content of a folder.

Permission:

Users must have the PM_FACTORY permission assigned to their role to perform this action.

Structure:

DELETE /api/1.0/{workspace}/project/{prj_uid}/file-manager/folder?path={path}
Function: (doDeleteFolderProcessFilesManager)

Parameters:

NameTypeDescription
workspaceStringWorkspace name
prj_uidStringProject UID

Optional Parameter:

NameTypeDescription
pathStringFile path

Result:

TypeDescription
emptyNo return

Example:

Response

  200(OK)

List a Single File: GET project/{prj_uid}/file-manager/{prf_uid}

Gets the information of a single file.

GET /api/1.0/{workspace}/project/{prj_uid}/file-manager/{prf_uid}
Function: (doGetProcessFileManager)

Parameters:

NameTypeDescription
workspaceStringWorkspace name
prj_uidStringProject UID
prf_uidStringFile UID

Result:

TypeDescription
objectReturns an object

Example:

Response

 200(OK)
 {
    "prf_uid": "10135107353961aff6201c8069655112",
    "prf_filename": "file.html",
    "usr_uid": "00000000000000000000000000000001",
    "prf_update_usr_uid": "",
    "prf_path": "public/carpeta_1",
    "prf_type": "file",
    "prf_editable": 0,
    "prf_create_date": "2014-06-09 16:37:19",
    "prf_update_date": null,
    "prf_content": "contenido del documento"
 }