From 436d2086b227cba6db86e1ce97cd4684cb5f2705 Mon Sep 17 00:00:00 2001 From: Chirag-Bhatti Date: Thu, 2 Nov 2023 17:05:32 +0000 Subject: [PATCH] CLDC-2608: add documentation for the app api --- docs/adr/index.md | 2 +- docs/app_api.md | 15 +++++++++++++++ docs/documentation_website.md | 2 +- docs/form/index.md | 2 +- docs/setup.md | 2 +- 5 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 docs/app_api.md diff --git a/docs/adr/index.md b/docs/adr/index.md index 13abde54b..edb60b688 100644 --- a/docs/adr/index.md +++ b/docs/adr/index.md @@ -1,6 +1,6 @@ --- has_children: true -nav_order: 9 +nav_order: 10 --- # Architecture decisions diff --git a/docs/app_api.md b/docs/app_api.md new file mode 100644 index 000000000..093fd918f --- /dev/null +++ b/docs/app_api.md @@ -0,0 +1,15 @@ +--- +nav_order: 8 +--- + +# Using the App API + +In order to use the app as an API, you will need to configure requests to the API as so: + +* Configure your request with Basic Auth. Set the username to be the same as `API_USER` and password as the `API_KEY` (`API_USER` and `API_KEY` are environment variables that should be set for the application) +* Check the endpoint you are calling is an action that is `create`, `show` or `update` +* Check you are setting the following request headers: + * `Content-Type = application/json` + * `Action = application/json` N.B. If you use `*/*` instead, the request won't be recognised as an API request` + +Currently only the logs controller is configured to accept and authenticate API requests, when the above API environment variables are set. diff --git a/docs/documentation_website.md b/docs/documentation_website.md index ed1f1633e..9eb763050 100644 --- a/docs/documentation_website.md +++ b/docs/documentation_website.md @@ -1,5 +1,5 @@ --- -nav_order: 10 +nav_order: 11 --- # This documentation website diff --git a/docs/form/index.md b/docs/form/index.md index 148ffb1c4..664b136c7 100644 --- a/docs/form/index.md +++ b/docs/form/index.md @@ -1,6 +1,6 @@ --- has_children: true -nav_order: 8 +nav_order: 9 --- # Generating forms diff --git a/docs/setup.md b/docs/setup.md index 9b5c049c1..25d28dcf4 100644 --- a/docs/setup.md +++ b/docs/setup.md @@ -1,5 +1,5 @@ --- -nav_order: 2 +nav_order: 3 --- # Local development