I am writing a web platform that uses the API RESTFUL of SPTrans - Live Eye . Authenticate my session with the code:
<?php
$url = 'http://api.olhovivo.sptrans.com.br/v2.1/Login/Autenticar?token='.token;
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, "");
$result = curl_exec($curl);
curl_close($curl);
echo $result;
?>
That returns me
True
When I try to use the API in another piece of code, I have authentication problems.
<?php
$url = 'http://api.olhovivo.sptrans.com.br/v2.1/Linha/Buscar?termosBusca=8000';
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($curl);
curl_close($curl);
echo $result
?>
that returns
{"Message": "Authorization has been denied for this request."}
What am I doing wrong?
Thank you