# To support wildcard certificates, try to find existig TXT record and update it.
if _constellix_rest POST "domains/${_domain_id}/records""[{\"type\":\"txt\",\"add\":true,\"set\":{\"name\":\"${_sub_domain}\",\"ttl\":120,\"roundRobin\":[{\"value\":\"${txtvalue}\"}]}}]";then
if _constellix_rest GET "domains/${_domain_id}/records/TXT/search?exact=${_sub_domain}";then
_info "Added"
ifprintf -- "%s""$response"| grep "{\"errors\":\[\"Requested record was not found\"\]}" >/dev/null;then
return0
_info "Adding TXT record"
if _constellix_rest POST "domains/${_domain_id}/records""[{\"type\":\"txt\",\"add\":true,\"set\":{\"name\":\"${_sub_domain}\",\"ttl\":60,\"roundRobin\":[{\"value\":\"${txtvalue}\"}]}}]";then