From 3249a55f3a6f30fecc379659bc542d4b284ac52e Mon Sep 17 00:00:00 2001 From: schlypel Date: Wed, 29 Jun 2016 13:35:42 +0200 Subject: [PATCH] added API info to users page template --- management/templates/users.html | 41 +++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/management/templates/users.html b/management/templates/users.html index b369fa89..793f0ff0 100644 --- a/management/templates/users.html +++ b/management/templates/users.html @@ -84,6 +84,47 @@ +

Mail user API

+ +

Use your box’s Mail user API to add/change/remove users.

+ +

Usage:

+ +
curl -X VERB [-d "value"] --user {email}:{password} https://{{hostname}}/admin/mail/users[action]
+ +

(Brackets denote an optional argument.)

+

(Adding ?format=json will give json encoded results)

+ +

Verbs

+ + + + + + + + +
Verb Action
GET Returns a list of existing mail users.
POST/add Adds a new mail user. Required parameters are email and password.
POST/remove Removes a mail user. Required parameter is email.
POST/privileges/add Used to make a mail user an admin. Required parameters are email and privilege=admin.
POST/privileges/remove Used to remove the admin privilege from a mail user. Required parameter is email.
+ +

Examples:

+ +

Try these examples. For simplicity the examples omit the --user me@mydomain.com:yourpassword command line argument which you must fill in with your email address and password.

+ +
# Gives a json encoded list of all mail users
+curl -X GET https://{{hostname}}/admin/mail/users?format=json
+
+# adds a new email user
+curl -X POST -d "email=new_user@mydomail.com" -d "password=s3curE_pa5Sw0rD" https://{{hostname}}/admin/mail/users/add
+
+# removes a email user
+curl -X POST -d "email=new_user@mydomail.com" https://{{hostname}}/admin/mail/users/remove
+
+# adds admin privilege to an email user
+curl -X POST -d "email=new_user@mydomail.com" -d "privilege=admin" https://{{hostname}}/admin/mail/users/privileges/add
+
+# removes admin privilege from an email user
+curl -X POST -d "email=new_user@mydomail.com" https://{{hostname}}/admin/mail/users/privileges/remove
+