API v1

Our api is very easy to use and it is using json so for all requests/responses.
HTTP Response will always have status and message set, but if status is true then the request is ok, if not you will see the error in the message value.


Add new record

Here is an example where we add a new record, all values except dst_ip is mandatory, if dst_ip is not specified it will automatically set the requestors ip.
Time restriction is set to max one request every 5 seconds.

HTTP Request

curl -H "Content-Type: application/json" -X POST -d '{"username": "myuser", "password": "mypassword", "task": "addrecord", "dst_ip": "127.0.0.1", "record": "testrecord.mydhost.com"}' https://freemyhost.org/api/v1

HTTP Response

{"status": true, "message": "", "hostname": "testrecord.mydhost.com", "dst_ip": "127.0.0.1", "accesskey": "myaccesskey"}

Delete record

Here is an example how you can remove a record, all values is mandatory.
Time restriction is set to max one request every 3 seconds.

HTTP Request

curl -H "Content-Type: application/json" -X POST -d '{"username": "myuser", "password": "mypassword", "task": "deleterecord", "record": "myrecord", "accesskey": "myaccesskey'"}' https://freemyhost.org/api/v1

HTTP Response

{"status": true, "message": "record deleted"}

Update record

Here is an example how you can update a record, all values except dst_ip is mandatory, if dst_ip is not specified it will automatically set the requestors ip. Time restriction is set to max one request every 3 seconds.

HTTP Request

curl -H "Content-Type: application/json" -X POST -d '{"username": "myusername", "password": "mypassword", "task": "updaterecord", "record": "testrecord.mydhost.com'", "dst_ip": "127.0.0.1", "accesskey": "myaccesskey'"}' https://freemyhost.org/api/v1

HTTP Response

{"status": true, "message": "record updated", "dst_ip": "127.0.0.1"}

Get record statistics

Here is an example where we collect statistics for a specific record, all values is mandatory.
Time restriction is set to max one request every 3 seconds.

HTTP Request

curl -H "Content-Type: application/json" -X POST -d '{"username": "myuser", "password": "mypassword", "task": "getstatistics", "accesskey": "myaccesskey"}' https://freemyhost.org/api/v1

HTTP Response

{"status": true, "message": "", "hostname": "testrecord.mydhost.com", "last_query": 1432712418, "created": 1432712418, "valid_queries": 0, "valid_updates": 0, "invalid_updates": 0, "last_updated": 1432712418, "dst_ip": "127.0.0.1"}