diff --git a/To-delete-an-app.md b/To-delete-an-app.md index 42eb427..b8705e2 100644 --- a/To-delete-an-app.md +++ b/To-delete-an-app.md @@ -1,42 +1,68 @@ # To delete an app: -## HTTP request type: `POST` +## HTTP request type: `DELETE` ## Authorization required: Yes (Header: Bearer auth, key is located in .env file) -## Endpoint: `/delete?id=[application id]` +## Endpoint: `/deleteapp` -## Parameters required: No +## Parameters required: + +``` + { + "appid": "011758035553" + } +``` ### Output: If it is successful: ``` -App deleted successfully +{ + "message": "App deleted successfully" +} Status code: 200 ``` -If there is no token or a invalid token: +If there is no token specified in header: ``` -Unauthorized +{ + "error": "No authorization header" +} Status code: 401 ``` + +If there is a invalid token: +``` +{ + "error": "Invalid token" +} + +Status code: 401 +``` + If there is no app ID specified: ``` -App ID is required +{ + "error": "App not found" +} Status code: 400 ``` If there is a invalid app ID specified: ``` -App not found +{ + "error": "App not found" +} Status code: 404 ``` If there is a problem while saving apps.json onto the host: (likely cause is directory where the binary is located is set to read only) ``` -Failed to save apps +{ + "error": "Failed to save file" +} Status code: 500 ``` \ No newline at end of file