1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- <?php
- $params['work_id'] = 123;
- $params['task_id'] = 324;//"2019-10-28T13:00:00";
- $params['measurement_stage'] = 444;//"2019-10-28T13:00:00";
- TWXrequest($params);
- function TWXrequest($params)
- {
- $url = "http://qaplatform.digitaldepot.ru:8085/Thingworx/Things/2050UserLibrary/Services/check_hw_measurements_ready";
- //$url = "http://qaplatform.digitaldepot.ru:8085/Thingworx/Things/connSmoppLibrary/Services/get_section_info";
-
- $jsonEncoded = json_encode($params);
- $curl = curl_init();
- curl_setopt($curl, CURLOPT_URL, $url);
- curl_setopt($curl, CURLOPT_HTTPHEADER, array("Content-Type: application/json", "AppKey: 33cd23bb-3b03-4638-afef-7104a13e9211", "Accept:application/json"));
- // curl_setopt($curl, CURLOPT_USERPWD, sprintf('%s:%s', "Smopp", "2050.Digital"));
- curl_setopt($curl, CURLOPT_TIMEOUT, 60);
- curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
- curl_setopt($curl, CURLOPT_POST, 1);
- curl_setopt($curl, CURLOPT_POSTFIELDS, $jsonEncoded);
- curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
- curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
- // var_dump($jsonEncoded);
- $result = curl_exec($curl);
- //016 11360336 e6b6b19d-d9c3-11e9-80d5-005056011052
- //016 11360328 e6b6b19e-d9c3-11e9-80d5-005056011052
- // $uuid = json_decode($result)->RemarkId;
- // echo "uuid ".$uuid;
- // curl_close($curl);
- var_dump($result);
- // var_dump($result);
- }
- ?>
|