Papa-ri
January 12, 2021, 4:05pm
#1
Hi so i’m planning to get 100 domains and add them to cloudflare however i will be adding DNS records through API and for that i need the Zone ID from the overview dashboard of each domain !
Is there a way i can get all 100 Zone ID’s from all domain without going manaully one by one with a browser ???
M4rt1n
January 12, 2021, 4:10pm
#2
1 Like
Papa-ri
January 12, 2021, 6:53pm
#4
hi yes exactly got it to work with zennposter but getting all of the data from the domain which i don’t need
is there a way to get only domain name and the zone id just two ?
With this
curl -X GET “https://api.cloudflare.com/client/v4/zones?name=example.com&status=active&account.id=01a7362d577a6c3019a474fd6f485823&account.name=Demo Account&page=1&per_page=20&order=status&direction=desc&match=all”
-H “X-Auth-Email: [email protected] ”
-H “X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41”
-H “Content-Type: application/json”
this what i get
michael
January 12, 2021, 8:39pm
#5
You can pipe the results into jq . I use a filter like the following:
jq '.result[] | "\(.id) \(.name)"'
2 Likes
Papa-ri
January 12, 2021, 9:12pm
#6
Thanks for replaying can u please make me an example as I’m new at all this)) do I at Ur string to the end of the header?
sdayman
January 12, 2021, 9:20pm
#7
That was the example. It runs straight on the command line. You just pipe the output of your Curl command into what he posted.
Papa-ri
January 12, 2021, 9:22pm
#8
hi i missed the jq link )) tried it sill doesn’t work
michael
January 12, 2021, 9:33pm
#9
jpplay is only asking you for the filter:
.result[] | "\(.id) \(.name)"
You can see at the bottom of your screenshot that you have a different command running to the one I gave as an example.
2 Likes
Papa-ri
January 12, 2021, 9:35pm
#10
Omg mad your a life savor !!! thanks you above guys helped me all day too friends if you need any help with RU or arabic stuff pm me i will do my best thanks you so much for helping a noob out cheers
1 Like
system
closed
January 13, 2021, 9:35pm
#11
This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.