Having issues with API token authentication. I can create a new DNS record like this:
URL: https://api.cloudflare.com/client/v4/zones/<ZONE_ID/dns_records/
Method: POST
Header: Authorization: Bearer
DATA: {“type”=“A”, “name”:“www”,“content”:“1.1.1.1”,“ttl”:300,“proxied”:false}
and it works. But when I try to update the newly created record like this:
URL: https://api.cloudflare.com/client/v4/zones/<ZONE_ID/dns_records/<DNS_RECORD_ID>
Method: PUT
Header: Authorization: Bearer
DATA: {“type”=“A”, “name”:“www”,“content”:“1.1.1.2”,“ttl”:300,“proxied”:false}
authentication fails. But the same request works fine with the Global API key:
URL: https://api.cloudflare.com/client/v4/zones/<ZONE_ID/dns_records/<DNS_RECORD_ID>
Method: PUT
Header: X-Auth-Email: [email protected]
Header: X-Auth-Key: <GLOBAL_KEY>
DATA: {“type”=“A”, “name”:“www”,“content”:“1.1.1.2”,“ttl”:300,“proxied”:false}
How can I update a record with a token?