From 77cb1fb37c0da5bad39b3905f7a48cd3f176bac7 Mon Sep 17 00:00:00 2001 From: "R. Miles McCain" Date: Sat, 27 Aug 2022 14:52:02 -0700 Subject: [PATCH] Improve language --- GUIDE.md | 12 +++++----- .../templates/account/password_change.html | 5 +++-- .../dashboard/pages/service_update.html | 22 +++++++++---------- 3 files changed, 18 insertions(+), 21 deletions(-) diff --git a/GUIDE.md b/GUIDE.md index 40e2916..be2ef7f 100644 --- a/GUIDE.md +++ b/GUIDE.md @@ -211,15 +211,13 @@ Fortunately, Shynet offers a simple method you can call from anywhere within you ### API -All data displayed on dashboard can be obtained via API on url ```//shynet.example.com/api/dashboard/```. -By default this url return full data from all services from last 30 days. -Authentication header should be set to use user's parsonal API token (```'Authorization:Token '```). +All the information displayed on the dashboard can be obtained via API on url ```//shynet.example.com/api/dashboard/```. By default this endpoint will return the full data from all services over the last last 30 days. The `Authentication` header should be set to use user's parsonal API token (```'Authorization: Token '```). There are 4 optional query parameters: - * uuid - to get data only from one service - * startDate - to set start date in format YYYY-MM-DD - * endDate - to set end date in format YYYY-MM-DD - * basic - to get only basic data set to '1' or 'true' + * `uuid` - to get data only from one service + * `startDate` - to set start date in format YYYY-MM-DD + * `endDate` - to set end date in format YYYY-MM-DD + * `basic` - to get only basic data set to '1' or 'true' Example in HTTPie: ```http get '//shynet.example.com/api/dashboard/?uuid={{service_uuid}}&startDate=2021-01-01&endDate=2050-01-01&basic=1' 'Authorization:Token {{user_api_token}}'``` diff --git a/shynet/dashboard/templates/account/password_change.html b/shynet/dashboard/templates/account/password_change.html index 2a68a1d..6bb4a6e 100644 --- a/shynet/dashboard/templates/account/password_change.html +++ b/shynet/dashboard/templates/account/password_change.html @@ -13,13 +13,14 @@
-

Personal API token

+

Personal API token

{{request.user.api_token}} - +
+

To learn more about the API, see our API guide.

{% endblock %} diff --git a/shynet/dashboard/templates/dashboard/pages/service_update.html b/shynet/dashboard/templates/dashboard/pages/service_update.html index 67ba6e5..aeb2c58 100644 --- a/shynet/dashboard/templates/dashboard/pages/service_update.html +++ b/shynet/dashboard/templates/dashboard/pages/service_update.html @@ -31,21 +31,19 @@
-
-
API
-

Service data can be accessed via API on url:

- {{script_protocol}}{{request.get_host}}{% url 'api:services' %}?uuid={{object.uuid}} +
API
+
+

Shynet provides a simple API that you can use to pull data programmatically. You can access this data via this URL:

+ {{script_protocol}}{{request.get_host}}{% url 'api:services' %}?uuid={{object.uuid}}

- There are 2 optional query parameters: -

    -
  • startDate - to set start date in format YYYY-MM-DD
  • -
  • endDate - to set end date in format YYYY-MM-DD
  • -
+ There are 2 optional query parameters: +
    +
  • startDate — to set the start date (in format YYYY-MM-DD)
  • +
  • endDate — to set the end date (in format YYYY-MM-DD)
  • +

-

Example using HTTPie:

- http get '{{script_protocol}}{{request.get_host}}{% url 'api:services' %}?uuid={{object.uuid}}&startDate=2021-01-01&endDate=2050-01-01' 'Authorization:Token {{request.user.api_token}}'

Example using cURL:

- curl -H 'Authorization:Token {{request.user.api_token}}' '{{script_protocol}}{{request.get_host}}{% url 'api:services' %}?uuid={{object.uuid}}&startDate=2021-01-01&endDate=2050-01-01' + curl -H 'Authorization: Token {{request.user.api_token}}' '{{script_protocol}}{{request.get_host}}{% url 'api:services' %}?uuid={{object.uuid}}&startDate=2021-01-01&endDate=2050-01-01'
{% endblock %}