summaryrefslogtreecommitdiff
path: root/curl.sh
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-01-01 15:31:33 -0600
committerJeff Carr <[email protected]>2024-01-01 15:31:33 -0600
commitf1a0d18ac19d0db4f7060ea5a5c662348118e399 (patch)
treef2e454da9c3ff512b6548ce741825261178a6a56 /curl.sh
initial commit of cloudflare api
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'curl.sh')
-rwxr-xr-xcurl.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/curl.sh b/curl.sh
new file mode 100755
index 0000000..13a477d
--- /dev/null
+++ b/curl.sh
@@ -0,0 +1,23 @@
+#
+# this curl POST will create a new DNS resource record (RR) in zone the wit.com
+# In this case it will map www3.wit.com to a IPv6 address
+# replace the auth key (e088...) and zone ID (27b9...) with the ones from your cloudflare account
+#
+curl --request POST \
+ --url https://api.cloudflare.com/client/v4/zones/27llxxPutYourZoneIDherexxx497f90/dns_records \
+ --header 'Content-Type: application/json' \
+ --header 'X-Auth-Key: e08806adxxxPutYourAPIKeyHerexxxxa7d417a7x' \
+ --header 'X-Auth-Email: [email protected]' \
+ --data '{
+ "name": "www3",
+ "type": "AAAA"
+ "content": "2001:4860:4860::5555",
+ "ttl": 3600,
+ "proxied": false,
+ "comment": "WIT DNS Control Panel",
+}'
+
+# This will verify an API token
+curl -X GET "https://api.cloudflare.com/client/v4/user/tokens/verify" \
+ -H "Authorization: Bearer AAAPutYourTokenInHereSoYouCanTestItL5Cl3" \
+ -H "Content-Type:application/json"