Hi,
I am trying to create a token in php with the REST API on our Portal.
$url_base = "https://potal-url/portal";
$url = $url_base . "/sharing/rest/generateToken";
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded'));
$dataT = "username=<username>&password=<password>&client=referer&referer=$url_base&f=json";
curl_setopt($curl, CURLOPT_POSTFIELDS, $dataT);
echo $curl;
echo $dataT;
echo "<br>";
$result = curl_exec($curl);
echo('<br>Result Token: ' . $result);
curl_close($curl);
But no token is been printed in line 18.
you may try the request into Postman and then you can produse the required code