Questions and discussion about using ProcessMaker: user interface, running cases & functionality

Moderators: ArturoRobles, ArturoRobles

By rohitambre
Hi everyone,

I want to use Processmaker's REST APIs to perform all activities of process. Processmaker's documentation is quite good and I am able to perform actions but I'm stuck at file upload from single, multi file and grid file upload.

I read other posts about the same and I am also using ExtraRest plugin which is really very helpful but I was unable to find an API to upload files only through any javascript Frontend library.

Can anyone help me for FIle upload from REST endpoints.
User avatar
By programerboy
You can use a code like this:
Code: Select all
function uploadInputDocument($caseId, $taskId, $inputDocId, $inputDocComment, $filePath)
	$aVars = array(
	   'inp_doc_uid'     => $inputDocId,
	   'tas_uid'         => $taskId,
	   'app_doc_comment' => (!empty($inputDocComment)?$inputDocComment:'This is from webserice!'),
	   'form'            => (phpversion() >= "5.5") ? new CurlFile($filePath) : '@' . $filePath
	return pmRestRequest('POST', $_SERVER['HTTP_HOST'], '/api/1.0/'.config("system.workspace").'/cases/'.$caseId.'/input-document', $aVars);

$document = uploadInputDocument($caseId, $taskId, $inputDocId, 'your file comment', 'your path file');
if($document->status == 200){
	echo 'ERROR UPLOAD<br/>';
} ... 1iw/videos
CRUD and Process

Liliana i want to hear your answer if i say "[…]

Enabling SQL Server in Windows

I’m excited to uncover this page. I need to […]

Hi, Please use query like this: SELECT Forneced.[…]

Casos estão carregando em branco

Boa tarde! Prezados, estou com problemas em algun[…]