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 Endpoints
- Get Files List:
GET project/{prj_uid}/file-manager?path={path}
- Create file:
POST project/{prj_uid}/file-manager
- Update the File Content:
PUT project/{prj_uid}/file-manager/{prf_uid}
- Upload a Document:
POST project/{prj_uid}/file-manager/{prf_uid}/upload
- Upload Files:
POST project/{prj_uid}/file-manager/{prf_uid}/upload
- Download a Document:
GET project/{prj_uid}/file-manager/{prf_uid}/download
- Delete a Document of a File:
DELETE project/{prj_uid}/file-manager/{prf_uid}
- Delete a File from the Project:
DELETE project/{prj_uid}/file-manager/folder?path={path}
- List a Single File:
GET project/{prj_uid}/file-manager/{prf_uid}
Process File Manager resources:
-
Name Description Type Value prj_uid Project UID String String of 32 characters prf_uid File UID String String of 32 characters prf_path Path name String "public/.../..." or "templates/.../..." path Path name String "public/.../..." or "templates/.../..." prf_filename File name String String content File content String String usr_uid UID of the user who created the document String String prg_update_usr_uid UID of the user who updated the document String String prf_type Registry type String String. It can be a file or folder. prf_editable Indicates if the registry is editable String String prf_create_date Document creation date Date Date prf_update_date Document update date Date Date prf_content Document content String String prf_derivation_screen Returns "true" if the template is used as a routing screen of a task or process. Otherwise, returns "false". String true|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:
-
Name Type Description workspace String Workspace name prj_uid String Project UID
Optional Parameter:
-
Name Type Description path String File path. For example: "templates" to retrieve only the process's templates.
Result:
-
Type Description array Returns an array of objects containing information about the files
Example:
Response
// 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:
-
Name Type Description workspace String Workspace name prj_uid String Project UID
Required Fields:
-
Name Type Description prf_path String Path name prf_filename String File name content String File content
Result:
-
Type Description object Returns an object containing information about the new file.
Example:
Request
{
"prf_filename": "file.html",
"prf_path": "public/carpeta_1",
"prf_content": "document content"
}
Response
{
"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:
-
Name Type Description workspace String Workspace name prj_uid String Project UID prf_uid String File UID
Required Fields:
-
Name Type Description content String File content
Result:
-
Type Description object Returns an object containing information about the file
Example:
Request
{
"prf_content": "modify content"
}
Response
{
"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:
-
Name Type Description workspace String Workspace name prj_uid String Project UID prf_uid String File UID
Result:
-
Type Description empty No return
Example:
Response
Upload Files: POST project/{prj_uid}/file-manager/{prf_uid}/upload
Available Version: As of ProcessMaker 3.4.0.
Upload and validate files to the Templates and Public Files directory.
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}/process-files-manager/{main_path}
Parameters:
Name Type Description workspace String Workspace name prj_uid String Project UID main_path String templates
orpublic
Result:
Type Description empty No return
Example:
Response
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:
-
Name Type Description workspace String Workspace name prj_uid String Project UID prf_uid String File UID
Result:
-
Type Description empty No return
Example:
Response
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:
-
Name Type Description workspace String Workspace name prj_uid String Project UID prf_uid String File UID
Result:
-
Type Description empty No return
Example:
Response
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:
-
Name Type Description workspace String Workspace name prj_uid String Project UID
Optional Parameter:
-
Name Type Description path String File path
Result:
-
Type Description empty No return
Example:
Response
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:
-
Name Type Description workspace String Workspace name prj_uid String Project UID prf_uid String File UID
Result:
-
Type Description object Returns an object
Example:
Response
{
"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"
}