API Documentation

Nanelo provides a powerful API which allows you to build 3rd-party integrations which can automatically add and delete DNS Records.

The API has only two endpoints so far, but we are planning on adding more in the future.


Making Requests

URL Structure

To make API Calls, you'll need to perform a GET or POST request to api.nanelo.com. All requests should be performed with SSL (HTTPS).

The URL always consist of the following structure:

https://api.nanelo.com/version/apikey/endpoint

The current API Version is v1, so an example request could look like this:

https://api.nanelo.com/v1/APIKEY-ABC-123/endpoint

Authentication

All API requests must be authenticated with a valid API Key. API Keys are bound to a specific Domain. Visit your Nanelo Account Settings to manage your API Keys.

There are two ways you can authenticate your API Requests:

1. API Key in URL

The simplest way to authenticate your API calls is by putting your API Key in each Request URL, after the API Version, like this:

https://api.nanelo.com/v1/SECRET-APIKEY-ABC-123/endpoint

2. API Key in Header

Another way to authenticate your API calls is by putting your API Key in a header called X-API-KEY and replacing the part in the URL where your API Key would normally be with "header". Here's how such an API call would look like with cURL:

curl -H "X-API-KEY:SECRET-APIKEY-ABC-123" https://api.nanelo.com/v1/header/endpoint

Parameters

Most API Endpoints require one or more parameters. You can either set those parameters as GET parameters in the URL or by sending them as POST parameters in the body.

Please make sure that all your data is properly urlencoded and UTF-8 encoded to avoid issues with special characters.

Response

All API responses will be in JSON format.

Every response will have an ok key, which will be either true or false, depending on the state of the API call. If the API call failed, ok will be false and there will be an error key which contains details on why the API call failed.

Example of a failed API call:

{
  "ok": false,
  "error": "Invalid Feed URL"
}

Example of a successful API call:

{
  "ok": true,
  "result": {
    "abc": "some data"
  }
}

API Endpoints

1. Add DNS Records

This API Endpoint allows you to add a new DNS Record to your DNS Zone.

Parameters:

  • name required
    The name of the full DNS Record. For example: subdomain.example.org
  • type required
    The type of the DNS Record. All Record Types listed on the Nanelo Dashboard are possible. For example: A
  • value required
    The value of the DNS Record. For example: 192.168.10.8
  • ttl
    The TTL of the DNS Record. All TTL values available on the Nanelo Dashboard are possible. If an invalid value is passed, the nearest matching supported TTL will be used. For example: 3600
  • priority
    The priority of the DNS Record. Useful for MX Records. For example: 5

2. Delete DNS Records

This API Endpoint allows you to all DNS Records matching your query. You need to specify a name, type and value of DNS Records to delete.

Parameters:

  • name required
    The name of the full DNS Record. For example: subdomain.example.org
  • type required
    The type of the DNS Record. All Record Types listed on the Nanelo Dashboard are possible. For example: A
  • value required
    The value of the DNS Record. For example: 192.168.10.8