Hello,
I’m trying send Curl command using local cloud, when I run the follow lines my server don’t receive request POST command
The variables #deviceID and $dispositivo already have the correct id and token
my server is 192.168.0.106
the php is up and working in this server
if I change the ip to spark cloud address, this lines works.
$url = "http://192.168.0.106/v1/devices/$deviceID/led/?access_token=$dispositivo";
// Initiate curl
$ch = curl_init();
// Disable SSL verification
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
// Will return the response, if false it print the response
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// Set the url
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, array('params' => 'l1,HIGH'));
curl_setopt($ch, CURLOPT_TIMEOUT_MS, 5000);
// Execute
$result=curl_exec($ch);
curl_exec($ch);
// Closing
curl_close($ch);
when I try in firefox
http://192.168.0.106:8080/v1/devices/54ff6e0666349058495430567/led/?access_token=34ad9d70e9a8a9bbc0d63f177c49834926516?params=l1,HIGH
I receive it:
{
“code”: 400,
“error”: “invalid_grant”,
“error_description”: “The access token provided is invalid.”
}
But the access token is correct.
Where is the problem?