joshuaavalon/SynologyCloudflareDDNS

Record ID?

Closed this issue · 2 comments

After running the curl command to obtain the Record ID I get the following output. Where can I find the Record ID in it?

{"result":{"id":"xxx",
"name":"abc.xyz",
"status":"active",
"paused":false,
"type":"full",
"development_mode":0,
"name_servers":["a.ns.cloudflare.com","b.ns.cloudflare.com"],
"original_name_servers":["ns2.hosting.com","ns1.hosting.com"],
"original_registrar":null,
"original_dnshost":null,
"modified_on":"2017-04-27T18:16:49.798322Z",
"created_on":"2017-04-12T19:37:00.509568Z",
"meta":{"step":4,
"wildcard_proxiable":false,
"custom_certificate_quota":0,
"page_rule_quota":3,
"phishing_detected":false,
"multiple_railguns_allowed":false},
"owner":{"type":"user",
"id":"XXX",
"email":"email@gmail.com"},
"permissions":["#analytics:read",
"#billing:edit",
"#billing:read",
"#cache_purge:edit",
"#dns_records:edit",
"#dns_records:read",
"#lb:edit",
"#lb:read",
"#logs:read",
"#organization:edit",
"#organization:read",
"#ssl:edit",
"#ssl:read",
"#waf:edit",
"#waf:read",
"#zone:edit",
"#zone:read",
"#zone_settings:edit",
"#zone_settings:read"],
"plan":{"id":"0feeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
"name":"Free Website",
"price":0,
"currency":"USD",
"frequency":"",
"is_subscribed":true,
"can_subscribe":false,
"legacy_id":"free",
"legacy_discount":false,
"externally_managed":false}},
"success":true,
"errors":[],
"messages":[]}

In addition which variables do I input into cloudflareddns.sh? Is it the following?

# CloudFlare Config
__RECID__=""
__ZONE_ID__=""

To answer my own question, Record ID is just the ID and yes those are the variables to add to cloudflareddns.sh.

Also I find the following curl to be better.

curl -s GET "https://api.cloudflare.com/client/v4/zones/[Zone ID]/dns_records" \
	-H "X-Auth-Email: [Email]" \
	-H "X-Auth-Key: [API Key" \
	-H "Content-Type: application/json" \
	| jq '.result[] | {name, id, zone_id, zone_name, content, type}'

It has written in the Readme.md.