[SOLVED] REST API connection from shared hosting

I am moving this code on a shared hosting, but the https call doesn’t work any more…

<form action="https://api.particle.io/v1/devices/DEVICE_ID_HERE/myFunction?access_token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
 method="POST" target="thisFrame" onsubmit="setTimeout(function(){reset();},1000);">
<input type="text" name="args" value="HELLO">
&nbsp;&nbsp;&nbsp;<input type="submit" value="SEND">

Need help :slight_smile:
Thanks !

Does the browser console say anything?

The API call works on dedicated Linux hosting (Apache 2.4 + SSL/TLS Encryption)
but doesn’t work on Windows hosting (IIS 8.5)


Hi All,
I solved rebooting the photon (strange :confused:), but now I have another issue with the php version.

On my new hosting the PHP is v5.5.19 and the code below write…
Curl error: SSL certificate problem: unable to get local issuer certificate

 $my_device = "xxxxxxxxxxxxxxxxxxxxxxxxxx";
 $my_token = "yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy";
 $url = "https://api.particle.io/v1/devices/".$my_device."/myFunction?access_token=".$my_token;
 $ch = curl_init( $url );
 curl_setopt( $ch, CURLOPT_POST, 1);
 curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1);
 curl_setopt( $ch, CURLOPT_POSTFIELDS, http_build_query(array('args' => $_POST["args"])));
 $response = curl_exec( $ch );
 if($response === false)
    echo 'Curl error: ' . curl_error( $ch ); 
 curl_close( $ch );

SOLVED adding

... curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, 0); ...