API Problem
Hello i have a problem with the cloudflare api v4.
I used the right api token but i got an Authentication error.
$response = Http::withHeaders([
'Content-Type' => 'application/json',
'Authorization' => 'Bearer xxx',
])
->post('https://api.cloudflare.com/client/v4/zones/xxx/dns_records', [
'content' => '1.1.1.1',
'name' => 'test.test.de',
'proxied' => false,
'type' => 'A',
'comment' => 'Record test',
'tags' => ['owner:dns-team'],
'ttl' => 3600,
]);
The curl testing is working at my computer. But I cant use the http api.9 Replies
What are the permissions of the API token?
Sorry it's in german. I used the "edit zone-dns" template.
That all looks right. Does the update work if it’s in curl?
I got the same error.
For the content of the record all the same stuff in your own zone? Wondered if it’s blocking on that. Can you make the same record in the dashboard to verify it’s correct then delete after.
I'm able to create the record in the panel.
Do you have an solution for this problem or should I write the cloudflare support?
I’d contact support at this stage
I fixed this. I had the wrong zone ID.