
Dot TK API Program / API Documentation
The Dot TK API lets you embed the Dot TK Free Domain Name registration process within your computer or online application. To use the API, you need to register for a Dot TK account or use your existing Dot TK account from My Dot TK.
Your API application needs to be reviewed and will be approved or declined within 24 hours.
After you submit your application, you can retrieve your API Token from My Dot TK immediately. You need the API Token to register free domain names under your account, using the API. Please note that actual free domain name registrations are not possible until your application is reviewed and approved. However, you are able to use the Dot TK API in test mode.
The API is accessible through https://secure.dot.tk/api/freedomain
The following parameters should be passed to the API by POST or GET method.
| Parameter | Type | Optional/ Mandatory | Remarks |
| command | String | Mandatory | Currently only 'ADD' |
| registrantnr | Number | Mandatory | The registrant number. This identifies you as the registrant. This number is available in My Dot TK directly after you signed up for your Dot TK API account. |
| token | String | Mandatory | An 18 character Application Token, which includes alphanumeric and numeric characters, both uppercase and lowercase. This Application Token is available in My Dot TK directly after you signed up for your Dot TK API account. |
| domainname | String | Mandatory | Maximum of 63 characters, all uppercase, only [A-Z], [0-9] and the dash (-) are allowed. It should always include the .TK extension. |
| url | String | Mandatory | Full URL to rename. Maximum of 300 characters, should always include http:// or https:// |
| output | String | Optional | 'XML' or 'TEXT'. If not specified, TEXT will be used. |
| test | Number | Optional | 1 or not defined. |
A call to any function of the API will return two parameters. The first parameter is result code. This is a number indicating whether or not the call was successful. Its value will be 1 on success, 0 on failure. The second parameter, result, will give a descriptive message.
The following table shows possible replies.
| Result code | Result | Remarks |
| 1 | APPROVED | Domain name was successfully registered with the registry. |
| 0 | DECLINED, UNKNOWN USER | Registrant number invalid, token invalid or combination invalid. |
| 0 | DECLINED, NO ACCESS | Status of API user is not authorized. |
| 0 | DECLINED, DOMAIN ALREADY REGISTERED | Domain name is already registered. |
| 0 | DECLINED, DOMAIN CANNOT BE REGISTERED | Domain name is trademark or special domain name and may not be registered for free. |
| 0 | ERROR, COMMAND NOT SUPPORTED | The specified command parameter is not supported. |
| 0 | ERROR, INVALID DOMAIN | Domain name specified invalid. |
| 0 | ERROR, INVALID URL | URL specified invalid or not accessible. |
| 0 | ERROR, MISSING PARAM | One or more parameters are missing. |
| 0 | ERROR, OTHER | Any other type of error has occurred. |
The output can be presented in two ways: TEXT or XML. By default the output will be 'TEXT'. With the request it is possible to specify the requested format.
When output is set to TEXT, the output will have the following format: RESULTCODE::RESULT
When output is set to XML, the output will have the following format:
After you have finished integrating the API, please test it before going live! You can test the Dot TK API with the test parameter. If you set this parameter to 1, your call will perform all checks but will not register a free domain.
Example scripts can be found below. If you cannot find the implementation you require, please refer to the Dot TK API Forum for more information.