Skip to content

Instantly share code, notes, and snippets.

@nferrari
Created March 31, 2015 15:34
Show Gist options
  • Save nferrari/a8d19b6e65c2f5c26941 to your computer and use it in GitHub Desktop.
Save nferrari/a8d19b6e65c2f5c26941 to your computer and use it in GitHub Desktop.
alwaysdata API post domain record
#!/usr/bin/python
import json
import requests
address = 'http://api.alwaysdata.com/v1/domain/record/'
credentials = ('APIKEY account=batman', '')
response = requests.post(
address,
auth=credentials,
verify=False,
data=json.dumps({
'domain': 123, # Your domain ID
'type': 'A',
'name': 'fromapi',
'value': '1.1.1.1',
})
)
print response.text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment