Closed kruisdraad closed 5 years ago
example for documentation:
$srvdata = [ 'weight' => 100, 'priority' => 100, 'proto' => '_tcp', 'port' => 1111, 'target' => 'a.x.c.', 'service' => '_test.v1' ];
if ($dns->addRecord($zoneID, "SRV", '', '', 120, false, '', $srvdata) === true) { echo "DNS record created.". PHP_EOL; }
You're right. proto
should be _tcp
but not tcp
. For those who met this issue.
Ill be submitting a PR linking to this issue, but the SDK is missing code to create and update SRV records and the fix seems simple enough.
In addition, if you change items like proto with a bad value 'tcp' instead of '_tcp' it the API cannot handle the error message and shows %s:
Caught exception: Client error:
POST https://api.cloudflare.com/client/v4/zones/xxxxxxx/dns_records
resulted in a400 Bad Request
response: {"success":false,"errors":[{"code":1004,"message":"DNS Validation Error","error_chain":[{"code":9150,"message":"%s"}]}],"messages":[],"result":null}