Share ideas, ask questions, and get feedback about developing for ProcessMaker
Forum rules: Please post new questions under "Developing processes & programming" for ProcessMaker 2 or 3.
By Anuradha
#786515
hello all,
We have used rest api to create case in one of our process ,now it is showing error while creating new case .
The error is :- Error in : Code: 400 Message: Bad Request: No connection params set for 42292423457bec68269fdf0069290847.
Can't get the error ,please help.
By Anuradha
#786540
Code: Select all
$accessToken = isset($_COOKIE['access_token']) ? $_COOKIE['access_token'] : getAccessToken();
if(isset($_POST['maintenance'])) {
		
		$maintenance_data = $_POST['maintenance'];		

		foreach ($maintenance_data as $maintenance_vehicle){
			//1.Create Case
			$endpoint = "/api/1.0/$pmWorkspace/cases";
			$post_array = array(
				"pro_uid" => $_POST['process'],
				"tas_uid" => $_POST['task_uid']
			);
			$result = pmRestRequest( "POST", $endpoint, $post_array ); 		
			$response = $result->response;			
			if ($result->status == 200) {
				//2.Put variable
				$aVars = array(
				   "vehicle_no" => $maintenance_vehicle,
				   "hub_id" => $_POST['hub'],
				   "task_created_date" =>date('Y-m-d')
				);     
				$caseId = $result->response->app_uid;
				$url = "/api/1.0/$pmWorkspace/cases/$caseId/variable"; 
				$oRet = pmRestRequest("PUT", $url, $aVars, $accessToken);
				if ($oRet->status == 200) {
				   echo "Task Generated and Case variables sent successfully.";
				   
				}		
			}	
		}//end of For loop
	}
	
User avatar
By amosbatto
#786544
I don't see any obvious errors in your code. Does the call to /api/1.0/$pmWorkspace/cases or /api/1.0/$pmWorkspace/cases/$caseId/variable cause the error? Can you execute other REST calls without problem? Can you post your complete code?
Want to create your own meme coin?

In the world of cryptocurrencies, a unique and exc[…]

The market for cryptocurrencies is demonstrating a[…]

What's SAP FICO?

Embarking on a dissertation can be one of the most[…]

Hello. For rental housing, there are software solu[…]