db122 Yes, completely doable!
We've actually just lit up our generated API docs (work-in-progress) in a couple of different formats:
We'll be putting out some tutorials and examples in our documentation in the coming weeks.
For now, if you're familiar with REST APIs, the method you want is dnsrecord/update
. You have to pass an authorization header containing your API token, prefaced by the string Token
.
Here's an example with curl
:
curl -X POST \
--header "Content-Type:application/json" \
--header "Authorization: Token API_TOKEN" \
--data '{"id":"DNS_UUID", "domain":"DOMAIN_UUID", "type":"A", "content": "IP_ADDRESS", "priority": 10, "ttl": 300 }' \
https://my.opalstack.com/api/v0/dnsrecord/update/
- Replace
API_TOKEN
with your token.
- Replace
DNS_UUID
with the UUID of the DNS record you want to update. You can get the UUID from the URL of whatever record in the control panel, or via the dns/list
API method.
- Replace
DOMAIN_UUID
with the UUID of the domain/subdomain for the A record. At the present time these aren't easily visible in the control panel, but you can see them in the page source at https://my.opalstack.com/domains/ or via the domain/list
API method.
- Replace
IP_ADDRESS
with the IP for the A record.
Also, our control panel is mostly a JS client for our API, so feel free to explore the page source in the various sections of the panel to see how it interacts with the API. 😃