<?php
/*
* Welcome to ProcessMaker 4 Script Editor
* To access Environment Variables use getenv("ENV_VAR_NAME")
* To access Request Data use $data
* To access Configuration Data use $config
* To preview your script, click the Run button using the provided input and config data
* Return an array and it will be merged with the processes data
* Example API to retrieve user email by their ID $api->users()->getUserById(1)['email']
* API Documentation https://github.com/ProcessMaker/docker-executor-php/tree/master/docs/sdk
*/
$start = microtime(true);
$guzzleClient = new \$GuzzleHttp\Client(['base_uri'=> getenv('API_HOST'),'verify' => false]);
$guzzleOptions['headers']['Accept'] = 'application/json';
$guzzleOptions['headers']['Authorization'] = 'Bearer'.getenv('API_TOKEN');
$guzzleApi = '/api/1.0/connector-idp/get-file/be74e981-f82c-data-b906-669724f0c37f';
$result = json_decode($guzzleClient->request('GET', $guzzleApi, $guzzleOptions)->getBody(),true)['data'];
return $result;
<?php
/*
* Welcome to ProcessMaker 4 Script Editor
* To access Environment Variables use getenv("ENV_VAR_NAME")
* To access Request Data use $data
* To access Configuration Data use $config
* To preview your script, click the Run button using the provided input and config data
* Return an array and it will be merged with the processes data
* Example API to retrieve user email by their ID $api->users()->getUserById(1)['email']
* API Documentation https://github.com/ProcessMaker/docker-executor-php/tree/master/docs/sdk
*/
$start = microtime(true);
$guzzleClient = new \$GuzzleHttp\Client(['base_uri'=> getenv('API_HOST'),'verify' => false]);
$guzzleOptions['headers']['Accept'] = 'application/json';
$guzzleOptions['headers']['Authorization'] = 'Bearer'.getenv('API_TOKEN');
$guzzleOptions['json'] = [
"attributes" => [
"fulltext" => "Hello World",
"name" => "Finance Invoice",
"documentType" => "Invoice"
]
];
$guzzleApi = '/api/1.0/connector-idp/get-file/be74e981-f82c-data-b906-669724f0c37f';
$result = json_decode($guzzleClient->request('GET', $guzzleApi, $guzzleOptions)->getBody(),true)['data'];
return $result;