I’m trying to access my Inspirehome API from hassio. To be fair to Inspirehome they publish a comprehesive API on their website here.
If you took me back 15 years I would have been fluent in php but times change and I am not familiar with the curl command.
This is from their API guidance page.
**PHP example**
$url = "https://www.inspirehomeautomation.co.uk/client/api1_3_1/api.php?";
$myvars = "action=connect&apikey=123456789&username=demolvpluszones&password=demolvpluszones";
$ch = curl_init( $url );
curl_setopt( $ch, CURLOPT_POST, 1);
curl_setopt( $ch, CURLOPT_POSTFIELDS, $myvars);
curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt( $ch, CURLOPT_HEADER, 0);
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1);
$key = curl_exec( $ch );
So how do I access the API from hassio? I know I can run curl as a shell command but curl_init, curl_setopt and the curlopt parameters? How do I deal with them?
I hope I have formatted this post appropriately. Thanks in advance