Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

By Ivan Denkov
Hey there,
I have strange problem here.
I started writing script yesterday for updating a domain name, and it was working fine. But today I am getting error:
string(81) "{"id":"unprocessable_entity","message":"Record type is not included in the list"}" {"type":"A","name":"home","data":"162.10.66.0"}
This is the code:
$ch = curl_init($request_uri);
$headers = array(
'Content-Type:application/json',
'Authorization: Bearer ' . file_get_contents('token.txt') );
$rawdata = array(
'type' => 'A',
'name' => 'sub',
'data' => '162.10.66.0',
'priority' => null,
'port' => null,
'weight' => null
);
$postdata = json_encode($rawdata);
$ch = curl_init(); // initiate curl
$url = "https://api.digitalocean.com/v2/domains/mydomain.org/records";
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$output = curl_exec ($ch); // execute
curl_close ($ch); // close curl handle
var_dump($output); // show output
echo $postdata;//show what I am posting
There is no difference how I format the json POST request - it never detects the type and returns that error.
Any help will appreciated.
Thanks, Ivan