From f373d7c50ca41a69f80f5cd1552ed09cf9439509 Mon Sep 17 00:00:00 2001 From: Nicco Kunzmann Date: Sat, 14 Sep 2019 03:10:34 +0200 Subject: [PATCH 1/2] documenting some endpoints of the api --- docs/extend/routes.md | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/docs/extend/routes.md b/docs/extend/routes.md index 087457242..8ee5a9f3d 100644 --- a/docs/extend/routes.md +++ b/docs/extend/routes.md @@ -12,7 +12,7 @@ On the backend, Flarum has three collections of routes: * `admin` These routes are accessible under `yourforum.com/admin/`. By default, there is only one `admin` route on the backend; the rest of the admin routing happens on the frontend. -* `api` These routes are accessible under `yourforum.com/api/` and make up Flarum's JSON:API. +* `api` These routes are accessible under `yourforum.com/api/` and make up Flarum's [JSON:API]. ### Defining Routes @@ -203,4 +203,19 @@ return [ $document->title = 'Users'; }) ]; -``` \ No newline at end of file +``` + +## JSON:API +[JSON:API]: #json_api + +This is an incomplete list of endpoints which Flarum provides. +Please note that extension may provide new endpoints or +extend existing ones. +Please add those you use. + +- Listing discussions + [/api/discussions](https://discuss.flarum.org/api/discussions) +- Listing discussions including relationships to other objects + [/api/discussions?include=user,lastPostedUser,firstPost,tags](https://discuss.flarum.org/api/discussions?include=user,lastPostedUser,firstPost,tags) +- Listing discussions in a category or tag + [/api/discussions?filter[q]=tag:TAG](https://discuss.flarum.org/api/discussions?filter[q]=tag:dev) From 8da87e631a027759f0cf0ba4b1ad98968138f227 Mon Sep 17 00:00:00 2001 From: Nicco Kunzmann Date: Sat, 14 Sep 2019 04:37:47 +0200 Subject: [PATCH 2/2] link to how endpoints are defined --- docs/extend/routes.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/extend/routes.md b/docs/extend/routes.md index 8ee5a9f3d..c4d5dedfc 100644 --- a/docs/extend/routes.md +++ b/docs/extend/routes.md @@ -209,7 +209,7 @@ return [ [JSON:API]: #json_api This is an incomplete list of endpoints which Flarum provides. -Please note that extension may provide new endpoints or +Please note that [extension may provide new endpoints][data-api-endpoints] or extend existing ones. Please add those you use. @@ -219,3 +219,5 @@ Please add those you use. [/api/discussions?include=user,lastPostedUser,firstPost,tags](https://discuss.flarum.org/api/discussions?include=user,lastPostedUser,firstPost,tags) - Listing discussions in a category or tag [/api/discussions?filter[q]=tag:TAG](https://discuss.flarum.org/api/discussions?filter[q]=tag:dev) + +[data-api-endpoints]: data.html#api-endpoints