From 05b3d33c69c33046f7dbd884752d94deb7194e48 Mon Sep 17 00:00:00 2001 From: Maxime Zammit Date: Wed, 26 Jun 2024 23:47:43 +0200 Subject: [PATCH] docs: update api.md --- docs/api.md | 183 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 179 insertions(+), 4 deletions(-) diff --git a/docs/api.md b/docs/api.md index bd8fc126..318970bf 100644 --- a/docs/api.md +++ b/docs/api.md @@ -1,6 +1,6 @@ # API documentation -_Documentation Last Review: 11.04.2022_ +_Documentation Last Review: 27.06.2024_ ## Regular workflow: @@ -274,7 +274,7 @@ Return: ``` -# SC?: Form cancel 🔐 +# SC7: Form cancel 🔐 | | | | ------ | ------------------------- | @@ -291,6 +291,7 @@ Return: Return: `200 OK` + ```json { "Status": 0, @@ -298,7 +299,7 @@ Return: } ``` -# SC?: Form delete +# SC8: Form delete | | | | ------- | -------------------------- | @@ -317,6 +318,7 @@ formID: Return: `200 OK` + ```json { "Status": 0, @@ -324,7 +326,7 @@ Return: } ``` -# SC?: Form infos from all forms +# SC9: Form infos from all forms | | | | ------ | ---------------- | @@ -349,6 +351,106 @@ Return: } ``` +# SC10: Add an owner to a form 🔐 + +| | | +| ------ |-----------------------------------| +| URL | `/evoting/form/{formID}/addowner` | +| Method | `POST` | +| Input | `application/json` | +```json +{ + "TargetUserID": "", + "PerformingUserID": "" +} +``` + +Return: + +`200 OK` + +```json +{ + "Status": 0, + "Token": "" +} +``` + +# SC11: Remove an owner from the form 🔐 + +| | | +|--------|--------------------------------------| +| URL | `/evoting/form/{formID}/removeowner` | +| Method | `POST` | +| Input | `application/json` | +```json +{ + "TargetUserID": "", + "PerformingUserID": "" +} +``` + +Return: + +`200 OK` + +```json +{ + "Status": 0, + "Token": "" +} +``` + +# SC12: Add a voter to the Form 🔐 + +| | | +| ------ |-----------------------------------| +| URL | `/evoting/form/{formID}/addvoter` | +| Method | `POST` | +| Input | `application/json` | +```json +{ + "TargetUserID": "", + "PerformingUserID": "" +} +``` + +Return: + +`200 OK` + +```json +{ + "Status": 0, + "Token": "" +} +``` + +# SC13: Remove a voter from the Form 🔐 + +| | | +|--------|--------------------------------------| +| URL | `/evoting/form/{formID}/removevoter` | +| Method | `POST` | +| Input | `application/json` | +```json +{ + "TargetUserID": "", + "PerformingUserID": "" +} +``` + +Return: + +`200 OK` + +```json +{ + "Status": 0, + "Token": "" +} +``` + # DK1: DKG init 🔐 | | | @@ -467,3 +569,76 @@ Status can be: - 2: transaction not included The token is an updated version of the token in the URL that can be used to check again the status of the transaction if it is not yet included. + +# A1: Add an admin to the AdminList 🔐 + +| | | +| ------ |---------------------| +| URL | `/evoting/addadmin` | +| Method | `POST` | +| Input | `application/json` | +```json +{ + "TargetUserID": "", + "PerformingUserID": "" +} +``` + +Return: + +`200 OK` + +```json +{ + "Status": 0, + "Token": "" +} +``` + +# A2: Remove an admin from the AdminList 🔐 + +| | | +| ------ |------------------------| +| URL | `/evoting/removeadmin` | +| Method | `POST` | +| Input | `application/json` | + +```json +{ + "TargetUserID": "", + "PerformingUserID": "" +} +``` + +Return: + +`200 OK` + +```json +{ + "Status": 0, + "Token": "" +} +``` + +# A3: Get the AdminList + + + +| | | +| ------ |----------------------| +| URL | `/evoting/adminlist` | +| Method | `GET` | +| Input | | + +Return: + +`200 OK` + +```json +{ + SCIPERs List +} +``` + +