Closed ririko5834 closed 7 months ago
Do you have a code snippet that reproduces the problem?
When I want to create or delete a DNS record, I get an error Response code 403 (Forbidden)
. When I view DNS records, it works and I don't get any error. I have an API token with permissions DNS:Edit and Zone:Edit. So what could be the problem?
I know why it shows, when I called API endpoint with CURL, I got this error
{
"result": null,
"success": false,
"errors": [{
"code": 1038,
"message": "You cannot use this API for domains with a .cf, .ga, .gq, .ml, or .tk TLD (top-level domain). To configure the DNS settings for this domain, use the Cloudflare Dashboard."
}],
"messages": []
}
The API wrapper's error catching should be improved, really high priority.
+1 Having this error My code:
module.exports = async (cf_api_token, cf_zone, cf_record_id) => {
var cf = require('cloudflare')({
token: cf_api_token
});
return await cf.dnsRecords.del(cf_zone, cf_record_id);
}
Nevermind, it was because I was trying to use a freenom domain.
When I want to create DNS record or delete DNS record I am getting
Response code 403 (Forbidden)
I am using
cloudflare.dnsRecords.add()
andcloudflare.dnsRecords.del()
methods.My API token perms: