12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- <form>
- <p>Субномер:</p>
- <input type="text" name="subnumber">
- <input type="submit" value="Отправить">
- </form>
- <?php
- //$subnumber = $_REQUEST['subnumber'];
- //$time = date('Y-m-d\TH:i:s');
- $params['user_id'] = "0231698c-e473-11e2-aaad-ac162db0b20c";
- // $params['user_id'] = "023169da-e473-11e2-aaad-ac162db0b20c";
- // $params['id_work'] = "735f7f76-5982-4b82-a60c-3b4a88d0d7eb";
- $params['id_work'] = "9957c42a-234f-4f8e-99e7-1b4f6165a422";
- // $params['id_reason'] = "прочее";
- // $params['comment'] = "прочее";
- TWXrequest($params);
- function TWXrequest($params)
- {
- //$url = "http://devplatform.digitaldepot.ru:8085/Thingworx/Things/SMoPPIntegrationLibrary/Services/work_detail";
- $url = "http://devplatform.digitaldepot.ru:8085/Thingworx/Things/2050UserLibraryExp/Services/work_detail";
- $jsonEncoded = json_encode($params);
- $curl = curl_init();
- curl_setopt($curl, CURLOPT_URL, $url);
- curl_setopt($curl, CURLOPT_HTTPHEADER, array("Content-Type: application/json", "AppKey: 6a7bdbaa-6bc1-4159-a2f4-07a13c8907d1", "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);
- }
- ?>
|