From b8825eddfb67e0b3a49a75166b7eaad35f7b4b1a Mon Sep 17 00:00:00 2001 From: paranarimasu <33796518+paranarimasu@users.noreply.github.com> Date: Wed, 4 May 2022 14:33:33 -0500 Subject: [PATCH] feat: specify endpoint authentication & provide basic syntax of requests (#18) --- docs/anime/index/README.md | 4 ++++ docs/anime/show/README.md | 4 ++++ docs/animesynonym/index/README.md | 4 ++++ docs/animesynonym/show/README.md | 4 ++++ docs/animetheme/index/README.md | 4 ++++ docs/animetheme/show/README.md | 4 ++++ docs/animethemeentry/index/README.md | 4 ++++ docs/animethemeentry/show/README.md | 4 ++++ docs/animeyear/index/README.md | 4 ++++ docs/animeyear/show/README.md | 4 ++++ docs/announcement/index/README.md | 4 ++++ docs/announcement/show/README.md | 4 ++++ docs/artist/index/README.md | 4 ++++ docs/artist/show/README.md | 4 ++++ docs/authentication/README.md | 22 ++++++++++++++++++++++ docs/balance/index/README.md | 4 ++++ docs/balance/show/README.md | 4 ++++ docs/config/flags/show/README.md | 4 ++++ docs/config/wiki/show/README.md | 4 ++++ docs/image/index/README.md | 4 ++++ docs/image/show/README.md | 4 ++++ docs/page/index/README.md | 4 ++++ docs/page/show/README.md | 4 ++++ docs/resource/index/README.md | 4 ++++ docs/resource/show/README.md | 4 ++++ docs/search/README.md | 4 ++++ docs/series/index/README.md | 4 ++++ docs/series/show/README.md | 4 ++++ docs/song/index/README.md | 4 ++++ docs/song/show/README.md | 4 ++++ docs/studio/index/README.md | 4 ++++ docs/studio/show/README.md | 4 ++++ docs/transaction/index/README.md | 4 ++++ docs/transaction/show/README.md | 4 ++++ docs/video/index/README.md | 4 ++++ docs/video/show/README.md | 4 ++++ 36 files changed, 162 insertions(+) diff --git a/docs/anime/index/README.md b/docs/anime/index/README.md index de27aa8..701a104 100644 --- a/docs/anime/index/README.md +++ b/docs/anime/index/README.md @@ -14,6 +14,10 @@ The anime index endpoint returns a listing of anime resources. GET /api/anime/ ``` +## Authentication + +None + ## Parameters | Name | Required | Description | diff --git a/docs/anime/show/README.md b/docs/anime/show/README.md index 24fa2f8..1098d4f 100644 --- a/docs/anime/show/README.md +++ b/docs/anime/show/README.md @@ -16,6 +16,10 @@ For example, the `/api/anime/bakemonogatari` endpoint will return the Bakemonoga GET /api/anime/{slug} ``` +## Authentication + +None + ## Parameters | Name | Required | Description | diff --git a/docs/animesynonym/index/README.md b/docs/animesynonym/index/README.md index cc40118..49438b3 100644 --- a/docs/animesynonym/index/README.md +++ b/docs/animesynonym/index/README.md @@ -14,6 +14,10 @@ The AnimeSynonym index endpoint returns a listing of AnimeSynonym resources. GET /api/animesynonym/ ``` +## Authentication + +None + ## Parameters | Name | Required | Description | diff --git a/docs/animesynonym/show/README.md b/docs/animesynonym/show/README.md index fc9a8ad..19447af 100644 --- a/docs/animesynonym/show/README.md +++ b/docs/animesynonym/show/README.md @@ -16,6 +16,10 @@ For example, the `/api/animesynonym/1523` endpoint will return the AnimeSynonym GET /api/animesynonym/{id} ``` +## Authentication + +None + ## Parameters | Name | Required | Description | diff --git a/docs/animetheme/index/README.md b/docs/animetheme/index/README.md index 201364d..a6fd676 100644 --- a/docs/animetheme/index/README.md +++ b/docs/animetheme/index/README.md @@ -14,6 +14,10 @@ The AnimeTheme index endpoint returns a listing of AnimeTheme resources. GET /api/animetheme/ ``` +## Authentication + +None + ## Parameters | Name | Required | Description | diff --git a/docs/animetheme/show/README.md b/docs/animetheme/show/README.md index 573cec7..955db90 100644 --- a/docs/animetheme/show/README.md +++ b/docs/animetheme/show/README.md @@ -16,6 +16,10 @@ For example, the `/api/animetheme/3373` endpoint will return the AnimeTheme reso GET /api/animetheme/{id} ``` +## Authentication + +None + ## Parameters | Name | Required | Description | diff --git a/docs/animethemeentry/index/README.md b/docs/animethemeentry/index/README.md index b8e4be7..7010032 100644 --- a/docs/animethemeentry/index/README.md +++ b/docs/animethemeentry/index/README.md @@ -14,6 +14,10 @@ The AnimeThemeEntry index endpoint returns a listing of AnimeThemeEntry resource GET /api/animethemeentry/ ``` +## Authentication + +None + ## Parameters | Name | Required | Description | diff --git a/docs/animethemeentry/show/README.md b/docs/animethemeentry/show/README.md index 9a0b064..0f12dc5 100644 --- a/docs/animethemeentry/show/README.md +++ b/docs/animethemeentry/show/README.md @@ -16,6 +16,10 @@ For example, the `/api/animethemeentry/3822` endpoint will return the second ver GET /api/animethemeentry/{id} ``` +## Authentication + +None + ## Parameters | Name | Required | Description | diff --git a/docs/animeyear/index/README.md b/docs/animeyear/index/README.md index 68e3bec..feb608a 100644 --- a/docs/animeyear/index/README.md +++ b/docs/animeyear/index/README.md @@ -14,6 +14,10 @@ The year index endpoint returns a list of unique years from all anime resources. GET /api/animeyear/ ``` +## Authentication + +None + ## Parameters None diff --git a/docs/animeyear/show/README.md b/docs/animeyear/show/README.md index 3184be1..5571423 100644 --- a/docs/animeyear/show/README.md +++ b/docs/animeyear/show/README.md @@ -16,6 +16,10 @@ For example, the `/api/animeyear/2000` endpoint will return a listing of anime r GET /api/animeyear/{year} ``` +## Authentication + +None + ## Parameters | Name | Required | Description | diff --git a/docs/announcement/index/README.md b/docs/announcement/index/README.md index 465a880..706ab30 100644 --- a/docs/announcement/index/README.md +++ b/docs/announcement/index/README.md @@ -14,6 +14,10 @@ The announcement index endpoint returns a listing of announcement resources. GET /api/announcement/ ``` +## Authentication + +None + ## Parameters | Name | Required | Description | diff --git a/docs/announcement/show/README.md b/docs/announcement/show/README.md index 7665e80..1ab331f 100644 --- a/docs/announcement/show/README.md +++ b/docs/announcement/show/README.md @@ -14,6 +14,10 @@ The announcement show endpoint returns an announcement resource. GET /api/announcement/{id} ``` +## Authentication + +None + ## Parameters | Name | Required | Description | diff --git a/docs/artist/index/README.md b/docs/artist/index/README.md index c53edd4..e9099e3 100644 --- a/docs/artist/index/README.md +++ b/docs/artist/index/README.md @@ -14,6 +14,10 @@ The artist index endpoint returns a listing of artist resources. GET /api/artist/ ``` +## Authentication + +None + ## Parameters | Name | Required | Description | diff --git a/docs/artist/show/README.md b/docs/artist/show/README.md index c20bb1d..aee5072 100644 --- a/docs/artist/show/README.md +++ b/docs/artist/show/README.md @@ -16,6 +16,10 @@ For example, the `/api/artist/chiwa_saito` endpoint will return the artist resou GET /api/artist/{slug} ``` +## Authentication + +None + ## Parameters | Name | Required | Description | diff --git a/docs/authentication/README.md b/docs/authentication/README.md index 7afc0f4..7892618 100644 --- a/docs/authentication/README.md +++ b/docs/authentication/README.md @@ -10,6 +10,28 @@ The AnimeThemes API uses token-based authentication to grant the user access to API tokens can be granted abilities that specify which actions can be performed. +## Token Authentication + +The AnimeThemes API uses the [**Bearer authentication scheme**](https://www.rfc-editor.org/rfc/rfc6750.html) to validate requests for protected actions. + +The `Bearer` token in the `Authorization` request header must correspond to a valid API token. + +```sh +curl -X POST "https://staging.animethemes.moe/api/{protected action}" + -H "Accept: application/json" + -H "Authorization: Bearer {token}" +``` + +## Status Codes + +The AnimeThemes API uses framework-default response status codes for authenticated requests. + +| Code | Description | Examples | +| :--: | :--------------------------------------------------- | :----------------: | +| 200 | OK - request succeeded | DELETE, PATCH, PUT | +| 201 | Created - new resource was created | POST | +| 401 | Unauthorized - invalid or no authentication provided | All | + ## Managing Tokens API tokens are managed from the API Tokens Screen within the AnimeThemes application. diff --git a/docs/balance/index/README.md b/docs/balance/index/README.md index 01ec1da..d0c7167 100644 --- a/docs/balance/index/README.md +++ b/docs/balance/index/README.md @@ -14,6 +14,10 @@ The balance index endpoint returns a listing of balance resources. GET /api/balance/ ``` +## Authentication + +None + ## Parameters | Name | Required | Description | diff --git a/docs/balance/show/README.md b/docs/balance/show/README.md index f832e59..18708bb 100644 --- a/docs/balance/show/README.md +++ b/docs/balance/show/README.md @@ -14,6 +14,10 @@ The balance show endpoint returns a balance resource. GET /api/balance/{id} ``` +## Authentication + +None + ## Parameters | Name | Required | Description | diff --git a/docs/config/flags/show/README.md b/docs/config/flags/show/README.md index 3291ca1..2910e93 100644 --- a/docs/config/flags/show/README.md +++ b/docs/config/flags/show/README.md @@ -14,6 +14,10 @@ The flags show endpoint returns the flags resource. GET /api/config/flags ``` +## Authentication + +None + ## Parameters | Name | Required | Description | diff --git a/docs/config/wiki/show/README.md b/docs/config/wiki/show/README.md index cb4a57c..47432f1 100644 --- a/docs/config/wiki/show/README.md +++ b/docs/config/wiki/show/README.md @@ -14,6 +14,10 @@ The wiki show endpoint returns the wiki resource. GET /api/config/wiki ``` +## Authentication + +None + ## Parameters | Name | Required | Description | diff --git a/docs/image/index/README.md b/docs/image/index/README.md index c3ede04..c999576 100644 --- a/docs/image/index/README.md +++ b/docs/image/index/README.md @@ -14,6 +14,10 @@ The image index endpoint returns a listing of image resources. GET /api/image/ ``` +## Authentication + +None + ## Parameters | Name | Required | Description | diff --git a/docs/image/show/README.md b/docs/image/show/README.md index 57ce6ca..d803ba2 100644 --- a/docs/image/show/README.md +++ b/docs/image/show/README.md @@ -16,6 +16,10 @@ For example, `/api/image/435` endpoint will return the large cover image for the GET /api/image/{id} ``` +## Authentication + +None + ## Parameters | Name | Required | Description | diff --git a/docs/page/index/README.md b/docs/page/index/README.md index a3fd4b1..a0669d6 100644 --- a/docs/page/index/README.md +++ b/docs/page/index/README.md @@ -14,6 +14,10 @@ The page index endpoint returns a listing of page resources. GET /api/page/ ``` +## Authentication + +None + ## Parameters | Name | Required | Description | diff --git a/docs/page/show/README.md b/docs/page/show/README.md index 047f9cd..a285a04 100644 --- a/docs/page/show/README.md +++ b/docs/page/show/README.md @@ -14,6 +14,10 @@ The page show endpoint returns a page resource. GET /api/page/{slug} ``` +## Authentication + +None + ## Parameters | Name | Required | Description | diff --git a/docs/resource/index/README.md b/docs/resource/index/README.md index c423a85..a0260d9 100644 --- a/docs/resource/index/README.md +++ b/docs/resource/index/README.md @@ -14,6 +14,10 @@ The resource index endpoint returns a listing of external resources. GET /api/resource/ ``` +## Authentication + +None + ## Parameters | Name | Required | Description | diff --git a/docs/resource/show/README.md b/docs/resource/show/README.md index 541ba9a..fa8b463 100644 --- a/docs/resource/show/README.md +++ b/docs/resource/show/README.md @@ -16,6 +16,10 @@ For example, the `/api/resource/1083` will return the MyAnimeList resource for t GET /api/resource/{id} ``` +## Authentication + +None + ## Parameters | Name | Required | Description | diff --git a/docs/search/README.md b/docs/search/README.md index 0588523..fed1812 100644 --- a/docs/search/README.md +++ b/docs/search/README.md @@ -14,6 +14,10 @@ The global search endpoint returns a listing of wiki resources that match a give GET /api/search/ ``` +## Authentication + +None + ## Parameters | Name | Required | Description | diff --git a/docs/series/index/README.md b/docs/series/index/README.md index 1b7cb79..d4287f3 100644 --- a/docs/series/index/README.md +++ b/docs/series/index/README.md @@ -14,6 +14,10 @@ The series index endpoint returns a listing of series resources. GET /api/series/ ``` +## Authentication + +None + ## Parameters | Name | Required | Description | diff --git a/docs/series/show/README.md b/docs/series/show/README.md index 361617a..b6a0216 100644 --- a/docs/series/show/README.md +++ b/docs/series/show/README.md @@ -16,6 +16,10 @@ For example, the `/api/series/monogatari` endpoint will return the series resour GET /api/series/{slug} ``` +## Authentication + +None + ## Parameters | Name | Required | Description | diff --git a/docs/song/index/README.md b/docs/song/index/README.md index f462ac1..0c2491d 100644 --- a/docs/song/index/README.md +++ b/docs/song/index/README.md @@ -14,6 +14,10 @@ The song index endpoint returns a listing of song resources. GET /api/song/ ``` +## Authentication + +None + ## Parameters | Name | Required | Description | diff --git a/docs/song/show/README.md b/docs/song/show/README.md index 11feccc..015f9bb 100644 --- a/docs/song/show/README.md +++ b/docs/song/show/README.md @@ -16,6 +16,10 @@ For example, the `/api/song/3373` endpoint will return the song resource for the GET /api/song/{id} ``` +## Authentication + +None + ## Parameters | Name | Required | Description | diff --git a/docs/studio/index/README.md b/docs/studio/index/README.md index 87498e6..4cc9a5d 100644 --- a/docs/studio/index/README.md +++ b/docs/studio/index/README.md @@ -14,6 +14,10 @@ The studio index endpoint returns a listing of studio resources. GET /api/studio/ ``` +## Authentication + +None + ## Parameters | Name | Required | Description | diff --git a/docs/studio/show/README.md b/docs/studio/show/README.md index 3d354b0..486744d 100644 --- a/docs/studio/show/README.md +++ b/docs/studio/show/README.md @@ -16,6 +16,10 @@ For example, the `/api/studio/shaft` endpoint will return the studio resource fo GET /api/studio/{slug} ``` +## Authentication + +None + ## Parameters | Name | Required | Description | diff --git a/docs/transaction/index/README.md b/docs/transaction/index/README.md index fb0aa65..7b9b579 100644 --- a/docs/transaction/index/README.md +++ b/docs/transaction/index/README.md @@ -14,6 +14,10 @@ The transaction index endpoint returns a listing of transaction resources. GET /api/transaction/ ``` +## Authentication + +None + ## Parameters | Name | Required | Description | diff --git a/docs/transaction/show/README.md b/docs/transaction/show/README.md index 2a5c780..1499442 100644 --- a/docs/transaction/show/README.md +++ b/docs/transaction/show/README.md @@ -14,6 +14,10 @@ The transaction show endpoint returns a transaction resource. GET /api/transaction/{id} ``` +## Authentication + +None + ## Parameters | Name | Required | Description | diff --git a/docs/video/index/README.md b/docs/video/index/README.md index 0a66dee..dd65c64 100644 --- a/docs/video/index/README.md +++ b/docs/video/index/README.md @@ -14,6 +14,10 @@ The video index endpoint returns a listing of video resources. GET /api/video/ ``` +## Authentication + +None + ## Parameters | Name | Required | Description | diff --git a/docs/video/show/README.md b/docs/video/show/README.md index a8de7db..764cd23 100644 --- a/docs/video/show/README.md +++ b/docs/video/show/README.md @@ -16,6 +16,10 @@ For example, `/api/video/Bakemonogatari-OP1.webm` endpoint will return the video GET /api/video/{basename} ``` +## Authentication + +None + ## Parameters | Name | Required | Description |