From 4e0d7cd567e056a354c8e72a7aa5f990d43b0258 Mon Sep 17 00:00:00 2001 From: Anhad Jai Singh Date: Wed, 25 Oct 2017 22:58:32 +0530 Subject: [PATCH] Add missing config option in API docs - Add `api=yes` required to enable API - Change ports in examples from 8082 to 8081 to reflect default port in configs for Authoritative DNS --- docs/common/api/configsetting.rst | 2 +- docs/http-api/index.rst | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/docs/common/api/configsetting.rst b/docs/common/api/configsetting.rst index 2211dd0892..68aaad057d 100644 --- a/docs/common/api/configsetting.rst +++ b/docs/common/api/configsetting.rst @@ -16,5 +16,5 @@ ConfigSetting { "name": "webserver-port", "type": "ConfigSetting", - "value": "8082" + "value": "8081" } diff --git a/docs/http-api/index.rst b/docs/http-api/index.rst index 8127c5b04c..5bac7b6fa2 100644 --- a/docs/http-api/index.rst +++ b/docs/http-api/index.rst @@ -26,14 +26,17 @@ Enabling the API To enable the API, the webserver and the HTTP API need to be enbaled. Add these lines to the ``pdns.conf``:: - webserver=yes - webserver-port=8082 + api=yes api-key=changeme + webserver=yes + webserver-port=8081 + +The API endpoints run off of the same webserver, but the :ref:`setting-api` is required to enable API access. Setting :ref:`setting-api` also implicitly enables the webserver v4.1.x onwards. And restart, the following examples should start working:: - curl -v -H 'X-API-Key: changeme' http://127.0.0.1:8082/api/v1/servers/localhost | jq . - curl -v -H 'X-API-Key: changeme' http://127.0.0.1:8082/api/v1/servers/localhost/zones | jq . + curl -v -H 'X-API-Key: changeme' http://127.0.0.1:8081/api/v1/servers/localhost | jq . + curl -v -H 'X-API-Key: changeme' http://127.0.0.1:8081/api/v1/servers/localhost/zones | jq . JSON Objects ------------ -- 2.47.2