Getting Started
We provide a fully RESTful application programming interface (API) with direct and powerful access to a vast array of features. Companies, developers and researchers can incorporate our innovative services directly into software and services.The API provides both API-Key and OAuth2 authentication mechanisms and supports only application/json content type. The current RESTful API version is v2 and uses HTTPS requests to GET, POST and DELETE data. A combination of a resource path and an operation identifies a method of the API. For example, a GET /v2/dns method could query the list of domain names for DNS service while a POST /v2/dns could add or update a domain name for DNS service.
You may also review the IP update protocol to control the state of dynamic DNS service.
Authentication
The two available security schemes are API key and OAuth2 token. The API key never expires, while OAuth2 access tokens obtained using client id and secret expire in 8 hours and must be re-obtained by the calling application.API Key
1
Obtain API key
The API key uniquely identifies your account and you can create, reset or clear the key in the API Credentials area of the control panel.
2
Make an API call
With a valid API key in hand, you're ready to make a request to a REST interface. Below is a call to obtain a list of domain names which have DNS service. The simple request uses only the required input fields.
The API key is included in the header of your requests with the following syntax:
API-Key: <api-key>
.Example /v2/dns request
curl -X GET https://api.dynu.com/v2/dns \
-H "accept: application/json" \
-H "API-Key: <api-key>"
-H "accept: application/json" \
-H "API-Key: <api-key>"
If the call is successful, Dynu returns a list of domain names along with their basic details. You can find the same list of domain names in the control panel.
OAuth2
1
Obtain OAuth keys
The OAuth keys consist of
client_id
and secret
.
The keys uniquely identify your account and you can create, reset or clear the keys in the
API Credentials area of the control panel.
2
Get an Access Token
Make a
/v2/oauth/token
call using your application's OAuth keys for the basic authentication (the keys are the values of your client_id
and secret
).
When you run the command, Dynu generates and returns a new access token.Tip: If you're using cURL, supply the OAuth values like this:
-u {Client-Id}:{Secret}
. If you're using the Postman tool, enter the client_id
and secret
values on the Basic Auth tab using the client_id
as the username and the secret
as the password.Example access token request
curl -X GET https://api.dynu.com/v2/oauth2/token \
-H "accept: application/json" \
-u "EOJ2S-Z6OoN_le_KS1d75wsZ6y0SFdVsY9183IvxFyZp:EClusMEUk8e9ihI7ZdVLF5cZ6y0SFdVsY9183IvxFyZp"
-H "accept: application/json" \
-u "EOJ2S-Z6OoN_le_KS1d75wsZ6y0SFdVsY9183IvxFyZp:EClusMEUk8e9ihI7ZdVLF5cZ6y0SFdVsY9183IvxFyZp"
Sample response:
{
"access_token": "<Access-Token>",
;"token_type": "Bearer",
"expires_in": 28800
}
"access_token": "<Access-Token>",
;"token_type": "Bearer",
"expires_in": 28800
}
Note: The access token is valid for the number of seconds specified in the
expires_in
response value. You must have a valid access token to make API requests. Request a new token when the current one expires.
3
Make an API call
With a valid access token in hand, you're ready to make a request to a REST interface. Below is a call to obtain a list of domain names which have DNS service. The simple request uses only the required input fields.
The access token is an OAuth bearer token, and is included in the header of your requests with the following syntax:
Authorization: Bearer <access-token>
.Important: You must supply a valid access token to complete this request (generate a valid token using the example call above).
Example /v2/dns request
curl -X GET https://api.dynu.com/v2/dns \
-H "accept: application/json" \
-H "Authorization: Bearer <access-token>"
-H "accept: application/json" \
-H "Authorization: Bearer <access-token>"
If the call is successful, Dynu returns a list of domain names along with their basic details. You can find the same list of domain names in the control panel.