HTTP
POST /authorization/token HTTP/1.1
Host: api.ultradns.com
Content-Type: application/x-www-form-urlencoded
Content-Length: 67
grant_type=password&username=yourusername&password=yourpasswordcURL
curl --location 'https://api.ultradns.com/authorization/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=password' \
--data-urlencode 'username=yourusername' \
--data-urlencode 'password=yourpassword'Python
import requests
url = "https://api.ultradns.com/authorization/token"
payload = 'grant_type=password&username=yourusername&password=yourpassword'
headers = {
'Content-Type': 'application/x-www-form-urlencoded'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)Replace 'yourusername' and 'yourpassword' with your username and your password.
Notes
For most API requests, the content-type is application/json. However, login uses application/x-www-form-urlencoded.
When you are successful you'll receive an access_token which you can supply in an authorization header in subsequent transactions for the next hour (so no need to login again until that has expired).