Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

403 error #99

Closed
ririko5834 opened this issue Sep 28, 2021 · 5 comments
Closed

403 error #99

ririko5834 opened this issue Sep 28, 2021 · 5 comments

Comments

@ririko5834
Copy link

When I want to create DNS record or delete DNS record I am getting Response code 403 (Forbidden)

I am using cloudflare.dnsRecords.add() and cloudflare.dnsRecords.del() methods.

My API token perms:
image

@terinjokes
Copy link
Contributor

Do you have a code snippet that reproduces the problem?

@ririko5834
Copy link
Author

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?

@ririko5834
Copy link
Author

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.

@cixastra
Copy link

+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); 
}

@cixastra
Copy link

Nevermind, it was because I was trying to use a freenom domain.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants