PHP Post request problem

Hi, im developing this php application. At the end, i have a little php that send a php post request to my cloudbit and it works! 3 o 4 times in a row. After that i get this error:

php_network_getaddresses: getaddrinfo failed: uknown host

Weird behavior, because it work 3 o 4 times and then on 5 round, it crash and then i have to wait 5 minutes to start working again…

here is my php:

$cloudBitKey = *****
$deviceId = ‘*’;
$durationInMillis = 5000;
$value = 99;

$url = “$deviceId/output”;
$data = array(‘percent’ => $value, ‘duration_ms’ => $durationInMillis);
$options = array(
‘http’ => array(
“header” => ["Authorization: Bearer ". $cloudBitKey],
‘method’ => ‘POST’,
‘content’ => http_build_query($data),

$context = stream_context_create($options);
$result = file_get_contents($url, true, $context);
return $result;

Thnks in advance

@imunoze sorry for the lag here but care to change v3 to v2 and repeat your tests? Let me know how it goes.