API Access

Our RESTful API allows custom scripts to intergrate with the KODNS platform easily using GET requests

Obtaining an Auth Token

Getting credentials is pretty straight forward, the same system applies where a unique code is needed to complete setup

https://api.kodns.io/token.php

If successful:
{
     status: “200 OK”,
     authtoken: “363449xxx”,
     expiry: “1535484846”
}

If failed:
{
     status: “400 BAD REQUEST”,
     authtoken: “0”,
     expiry: “0”
}

  • status will be OK or BAD REQUEST depending on success or fail
  • authtoken is the uniqie numeric ID to use when creating a hostname
  • expiry is the time the key expires


Creating a Hostname

Here is the most difficult part as the response can vary depending on if the hostname is taken or not allowed

At present only kodns.net hostnames can be created, but in future we will allow custom domains as part of a premium tier

https://api.kodns.io/create.php?AuthToken=xxxxxxxxx&Hostname=test

If succesful:
{
     status: “200 OK”,
     uid: “123456789”,
     key: “123456789abcdefghijklmnopqrstuvwxyz”,
     hostname: “xyz123.kodns.net”
}

If failed:
 

  • status will be OK or BAD REQUEST depending on success or fail
  • uid is a uniqie ID for that hostname
  • key is a uniqie fingerprint for that hostname


Pushing IP Changes

Now the complicated part of creating a hostname is out the way it’s time for the easy bit!

https://api.kodns.io/push.php?UID=123456789&Key=abc…&IP=12.34.56.78

If successful:
{
     status: “200 OK”
}

If failed:
{
     status: “400 BAD REQUEST”
}

  • status will be OK or BAD REQUEST depending on success or fail

Deleting a Hostname

This is a pretty simple request, as above but we are requesting a different file

https://api.kodns.io/delete.php?UID=123456789&Key=abc…&IP=12.34.56.78

If successful:
{
     status: “200 OK”
}

If failed:
{
     status: “400 BAD REQUEST”
}

  • status will be OK or BAD REQUEST depending on success or fail

Final things to note

To prevent abuse requests may be delayed or rejected entirely if anomalies are detected by our system, you won’t need to worry about this though, unless you’re up to no good!

If you have a question or need help, Contact Us