- Added comprehensive AI Assistant system (aiassist/ directory): * Vector search and embedding capabilities * Typebot proxy integration * Elastic search functionality * Message classification and chat history * MCP proxy for external integrations - Implemented Court Status API (GetCourtStatus.php): * Real-time court document status checking * Integration with external court systems * Comprehensive error handling and logging - Enhanced S3 integration: * Improved file backup system with metadata * Batch processing capabilities * Enhanced error logging and recovery * Copy operations with URL fixing - Added Telegram contact creation API - Improved error logging across all modules - Enhanced callback system for AI responses - Extensive backup file storage with timestamps - Updated documentation and README files - File storage improvements: * Thousands of backup files with proper metadata * Fix operations for broken file references * Project-specific backup and recovery systems * Comprehensive file integrity checking Total: 26,461+ files added/modified including AWS SDK, vendor dependencies, and extensive backup system.
84 lines
2.2 KiB
PHP
84 lines
2.2 KiB
PHP
<?php
|
|
error_reporting(E_ALL);
|
|
ini_set('display_errors', '1');
|
|
|
|
//************get challenge token****************
|
|
$endpointUrl = "https://crm.clientright.ru/webservice.php";
|
|
$userName="api";
|
|
|
|
$ch = curl_init();
|
|
$url = $endpointUrl . "?operation=getchallenge&username=" . $userName;
|
|
curl_setopt($ch, CURLOPT_URL, $url);
|
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
|
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
|
|
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
|
|
|
|
$response = curl_exec($ch);
|
|
echo '<pre>';
|
|
echo 'Curl error: ' . curl_error($ch). '<br><br>';
|
|
echo PHP_EOL;
|
|
|
|
echo $response . '<br><br>';
|
|
|
|
$jsonResponse = json_decode($response, true);
|
|
|
|
$challengeToken = $jsonResponse['result']['token'];
|
|
echo 'Challenge token: ' . $challengeToken . '<br><br>';
|
|
|
|
//***************login******************
|
|
$userAccessKey = '4r9ANex8PT2IuRV'; //api
|
|
$generatedKey = md5($challengeToken.$userAccessKey);
|
|
|
|
curl_setopt_array($ch, array(
|
|
CURLOPT_RETURNTRANSFER => 1,
|
|
CURLOPT_URL => $endpointUrl,
|
|
CURLOPT_POST => 1,
|
|
CURLOPT_SSL_VERIFYPEER => 0,
|
|
CURLOPT_SSL_VERIFYHOST => 0,
|
|
CURLOPT_POSTFIELDS => array(
|
|
'operation'=>'login',
|
|
'username'=>$userName,
|
|
'accessKey'=>$generatedKey
|
|
)
|
|
));
|
|
|
|
$response = curl_exec($ch);
|
|
echo 'Curl error: ' . curl_error($ch). '<br><br>';
|
|
echo PHP_EOL;
|
|
|
|
echo $response . '<br><br>';
|
|
|
|
$jsonResponse = json_decode($response, true);
|
|
$sessionId = $jsonResponse['result']['sessionName'];
|
|
$userId = $jsonResponse['result']['userId'];
|
|
|
|
echo 'Session ID: ' . $sessionId . '<br>';
|
|
echo 'User ID: ' . $userId . '<br><br>';
|
|
|
|
|
|
//***************GetFilesList******************
|
|
|
|
//$endpointUrl .= '?operation=GetFilesList&clientId=12x4013863&cashNumber=1&shiftNumber=1&localNumber=1&sessionName='.$sessionId;
|
|
$params = array(
|
|
'operation'=>'GetFilesList',
|
|
'sessionName'=>$sessionId,
|
|
'inn'=>'643922466250',
|
|
'sms'=>'795372'
|
|
);
|
|
|
|
curl_setopt_array($ch, array(
|
|
CURLOPT_RETURNTRANSFER => 1,
|
|
CURLOPT_POST => 1,
|
|
CURLOPT_SSL_VERIFYPEER => 0,
|
|
CURLOPT_SSL_VERIFYHOST => 0,
|
|
CURLOPT_URL => $endpointUrl,
|
|
CURLOPT_POSTFIELDS => $params
|
|
));
|
|
$response = curl_exec($ch);
|
|
$output = json_decode($response, TRUE);
|
|
|
|
echo $response . '<br><br>';
|
|
print_r($output);
|
|
echo '</pre>';
|
|
|
|
curl_close($ch); |