Sender (SMTP(local) -> HTTP(RESTful) -> worker -> SMTP(worker))
methods: GET
url: /v1/users/$USERNAME
{
"stat" : 200 ,
"token" : " " ,
"data" : " "
}
{
"stat" : 404 ,
"token" : " " ,
"data" : " "
}
methods: GET
url: /v1/users/$USERNAME/password
header: "Password: $PASSWORD"
{
"stat" : 200 ,
"token" : " $USER_TOKEN" ,
"data" : " "
}
{
"stat" : 404 ,
"token" : " " ,
"data" : " "
}
methods: POST
url: /v1/users/$USERNAME/password
header: "Password: $PASSWORD"
header: "Token: $ADMIN_TOKEN"
header: "Admin: 0 | 1"
{
"stat" : 200 ,
"token" : " " ,
"data" : " "
}
{
"stat" : 401 ,
"token" : " " ,
"data" : " "
}
{
"stat" : 409 ,
"token" : " " ,
"data" : " "
}
methods: PUT
url: /v1/users/$USERNAME/password
header: "Oldpass: $OLDPASSWORD" // can't change is_admin unless itself is an admin, not require if admin token is given
header: "Newpass: $NEWPASSWORD" // optional if want to change ppassword
header: "Token: $ADMIN_TOKEN" // can change anything if use this
header: "Admin: 0 | 1" // if want to change is_admin, must be a admin(token) to change this field
{
"stat" : 200 ,
"token" : " " ,
"data" : " "
}
{
"stat" : 401 ,
"token" : " " ,
"data" : " "
}
{
"stat" : 403 ,
"token" : " " ,
"data" : " "
}
methods: DELETE
url: /v1/users/$USERNAME/password
header: "Password: $PASSWORD" // if provided, must be true password; if not provided, token must be an admin
header: "Token: $ADMIN_TOKEN" // if provided, must be an admin
{
"stat" : 200 ,
"token" : " " ,
"data" : " "
}
{
"stat" : 403 ,
"token" : " " ,
"data" : " "
}
methods: GET
url: /v1/mail/
header: "Token: $USERTOKEN"
{
"stat" : 200 ,
"token" : " " ,
"data" : {
"num" : $mail_num,
"size" : $mail_size,
"mails" : [
{
"id" : $mail_id,
"size" : $mail_size
}
]
}
}
{
"stat" : 401 ,
"token" : " " ,
"data" : " "
}
{
"stat" : 404 ,
"token" : " " ,
"data" : " "
}
methods: GET
url: /v1/mail/$MAILID
header: "Token: $USERTOKEN"
{
"stat" : 200 ,
"token" : " " ,
"data" : {
"id" : $mail_id,
"size" : $mail_size,
"content" : $BASE64_CODED_MAIL_CONTENT
}
}
{
"stat" : 401 ,
"token" : " " ,
"data" : " "
}
{
"stat" : 404 ,
"token" : " " ,
"data" : " "
}
methods: DELETE
url: /v1/mail/$MAILID
header: "Token: $USERTOKEN"
{
"stat" : 401 ,
"token" : " " ,
"data" : " "
}
{
"stat" : 404 ,
"token" : " " ,
"data" : " "
}
methods: POST
url: /v1/mail/
header: "Token: $USERTOKEN"
body:
{
"from" : $FROM_USER_EMAIL,
"to" : $TO_USER_EMAILS[],
"content" : $BASE64_ENCODED_CONTENT
}
{
"stat" : 401 ,
"token" : " " ,
"data" : " "
}
{
"stat" : 404 ,
"token" : " " ,
"data" : " "
}
{
"stat" : 500 ,
"token" : " " ,
"data" : " "
}