From 5adbd678db47dfc7f7218c9e065523ed7cbef140 Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Fri, 20 Oct 2017 14:15:53 +0300 Subject: [PATCH] Updated REST API (markdown) --- REST-API.md | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/REST-API.md b/REST-API.md index 85b710d..3aee2e3 100644 --- a/REST-API.md +++ b/REST-API.md @@ -28,7 +28,7 @@ When calling a production Wekan server, ensure it is running via HTTPS and has a | `/api/users/:id` | [Deletes an existing user.](#user-delete) | | `/api/users/:id` | [Gets a user's information.](#user-information) | | `/api/users` | [All of the users.](#user-list) | -| `/api/user` | [Gets a loggued-in user.](#user-loggued-in) | +| `/api/user` | [Gets a logged-in user.](#user-logged-in) | --- @@ -367,8 +367,8 @@ curl -H "Authorization: Bearer cwUZ3ZsTaE6ni2R3ppSkYd-KrDvxsLcBIkSVfOCfIkA" \ ] ``` -# User Loggued-in -Retrieves information about a loggued-in user with his auth token. +# User Logged-in +Retrieves information about a logged-in user with his auth token. | URL | Requires Auth | HTTP Method | | :--- | :--- | :--- | @@ -398,3 +398,30 @@ curl -H "Authorization: Bearer a6DM_gOPRwBdynfXaGBaiiEwTiAuigR_Fj_81QmNpnf" \ "profile": {} } ``` + +# Disable a user (the user is not allowed to login and his login tokens are purged) +```shell +curl -H "Authorization: Bearer t7iYB86mXoLfP_XsMegxF41oKT7iiA9lDYiKVtXcctl" \ + -H "Content-type:application/json" \ + -X PUT \ + http://localhost:3000/api/users/ztKvBTzCqmyJ77on8 \ + -d '{ "action": "disableLogin" }' +``` + +# Enable a user +```shell +curl -H "Authorization: Bearer t7iYB86mXoLfP_XsMegxF41oKT7iiA9lDYiKVtXcctl" \ + -H "Content-type:application/json" \ + -X PUT \ + http://localhost:3000/api/users/ztKvBTzCqmyJ77on8 \ + -d '{ "action": "enableLogin" }' +``` + +# The admin takes the ownership of ALL boards of the user (archived and not archived) where the user is admin on. +```shell +curl -H "Authorization: Bearer t7iYB86mXoLfP_XsMegxF41oKT7iiA9lDYiKVtXcctl" \ + -H "Content-type:application/json" \ + -X PUT \ + http://localhost:3000/api/users/ztKvBTzCqmyJ77on8 \ + -d '{ "action": "takeOwnership" }' +```