From f736171db81449a4afa898c8416885538e34a69d21e9361a8b37579517b9d3be Mon Sep 17 00:00:00 2001 From: aslan Date: Wed, 31 Dec 2025 14:59:42 +0100 Subject: [PATCH] Add logged user and user communities endpoint --- README.md | 2 +- VERSION | 2 +- docs/api/user.md | 35 +++++++++++++++++++++++++++++++++++ 3 files changed, 37 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0bded95..49ca87b 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,3 @@ # Nexlink -Communication protocol spec and API documentation +Spec and API documentation for a gamified communication protocol with AI support diff --git a/VERSION b/VERSION index cc21297..67f8d58 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.3.3 +0.3.4 diff --git a/docs/api/user.md b/docs/api/user.md index 68d2099..3c4b8fe 100644 --- a/docs/api/user.md +++ b/docs/api/user.md @@ -18,6 +18,20 @@ Returns a user with id = {id} } ``` +## GET /api/v1/user/logged + +_Requires an authorization header_ + +Returns id of the currently logged user based on the auth token + +### Response: + +```json +{ + "id": "string" +} +``` + ## POST /api/v1/user _Requires an authorization header_ @@ -106,3 +120,24 @@ Returns all sessions for a user with id = {id} ] } ``` + +## GET /api/v1/user/{id}/communities + +_Requires an authorization header_ + +Returns all communities for a user with id = {id} + +### Response: + +```json +{ + "id": "string", + "communities": [ + { + "id": "string", + "name": "string", + "description": "string" + } + ] +} +```