Get :identifier for updating DNS via API


#1

Hey,

I wanted to know is it possible to get the :identifier of a domain using the API.
Currently when you want to update a DNS record it requires from you :zone_identifier and :identifier check the link

I was able to get :zone_identifier by using https://api.cloudflare.com/client/v4/zones call but I can’t seem to find an API call for getting :identifier that you can see on web https://dash.cloudflare.com/account_id/domain_name in API section, Zone_ID. Which is why I am asking again, how can I get it with an API call?

Thanks in advance!!


#2

:identifier would appear to be the ID of a zone record, which you can obtain via https://api.cloudflare.com/#dns-records-for-a-zone-list-dns-records


#3

Thanks, worked! Although now I am going to be having two calls just to get the parameters for updating a DNS record, is there a better way of getting those two parameters in one call?


#4

Presumably not. I would not expect the zone ID to change, unless you remove it, so you could hardcode that bit. However if you want it fully dynamic you probably cant avoid these two calls, one for the zone and one for the zone’s records.


#5

Alright, thanks again!