Skip to content

Instantly share code, notes, and snippets.

@nferrari
Created October 19, 2015 12:13
Show Gist options
  • Save nferrari/1a61ff19f0ed18eb49ca to your computer and use it in GitHub Desktop.
Save nferrari/1a61ff19f0ed18eb49ca to your computer and use it in GitHub Desktop.
Create domain record on alwaysdata API
#!/usr/bin/env python
import json
import requests
address = 'https://api.alwaysdata.com/v1/domain/record/'
credentials = ('APIKEY account=foobar', '')
data = {
'name': '',
'domain': 1234,
'type': 'A',
'value': '1.2.3.4',
}
response = requests.post(
address,
auth=credentials,
data=json.dumps(data),
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment