cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1320
Views
0
Helpful
0
Replies

Connect php code with UCCX

Facu_mtz1054
Frequent Visitor
Frequent Visitor

Hi community. I really appreciate if you can help me to solve this problem.

I want to upload .xml file in UCCX with php.For the moment i want to authenticate with php in UCCX.I did some test with my actual code with other test websites and it works but it doesn't in the case of UCCX.

I'm new with php so if you can give me some tips it will be great.

Thank you.

<?php
$url='https://uccx-server/adminapi/document';//example url
$username='user';
$password='password';
$prueba="prueba";

$ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_HTTPHEADER,array('Content-Type: application/json','Content-Length '.strlen($prueba)));
    curl_setopt($ch, CURLOPT_HTTPGET, FALSE);
    curl_setopt($ch, CURLOPT_HEADER, FALSE);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,0);
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,0);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_USERPWD, "$username" . ":" . "$password");
    $output = curl_exec($ch);
    $info = curl_getinfo($ch);
curl_close($ch);

print_r($info);
echo $output;
?>
0 Replies 0