[SOLVED] Cannot GET or PUT on /dns_records using API

When using global API key:

  • GET on https://api.cloudflare.com/client/v4/zones works OK
  • GET on https://api.cloudflare.com/client/v4/zones/ZONE_ID works OK
  • GET on https://api.cloudflare.com/client/v4/zones/ZONE_ID/dns_records = 7000 No route for that URI
  • GET on https://api.cloudflare.com/client/v4/zones/ZONE_ID/dns_records/RECORD_ID = 7000 No route for that URI
  • PUT, PATCH, POST with type, name, content, ttl, proxied on https://api.cloudflare.com/client/v4/zones/ZONE_ID/dns_records and https://api.cloudflare.com/client/v4/zones/ZONE_ID/dns_records/RECORD_ID results in 1001 method_not_allowed

Any ideas?

Solved!

The problem was doubled slash when generating URL:

URL="https://api.cloudflare.com/client/v4/"
PATH="/zones/XXXXXXXXX/dns_records"

https://api.cloudflare.com/client/v4//zones/XXXXXXXXX/dns_records fails
while https://api.cloudflare.com/client/v4/zones/XXXXXXXXX/dns_records works.

1 Like