clumsy-tools-backend

Information

Base URL

https://webapi.clumsytools.com/fo/rest

Version 1.0-SNAPSHOT
Description
  • Authentication Notes:

    • The authentication is based on OAuth 2.0 Password flow, plus OpenId verification if an open account is involved.
    • If the user forgets password, the client can start a typical "forget password" flow, or ask the server to generate a random login code.
  • Response codes and corresponding data structure

    • Status Code = 200

      • Status: Success
      • Data Structure: Biz Object in JSON format or "{}" returned in Http Body
    • Status Code = 460

      • Status: Biz Error, i.e. Non-OAuth2 Error
      • Data Structure: ErrorResult Object (See below) in JSON format returned in Http Body
    • Status Code = 400 in OAuth2 token endpoint responses

      • Status: OAuth2 Token Request Failure
      • Data Structure: OAuth2 error response in JSON format returned in Http Body
    • Status Code = 400,401,403 in OAuth2 resource response

      • Status: OAuth2 Resource Request Failure, such as invalid token and token expired.
      • Data Structure: OAuth2 error response in JSON format returned in Http Header. See Oauth2 document
      • If you see "invalid_token", please let the user login again.
      • If you see "expired_token", please let the user login again or you can refresh the token.
Contact Nameclumsy-tools-backend@gmail.com

Table of Contents

todo

Index Method Path Summary
1 GET /todo/items Get all unfinished items of current user. It will sort by date asc. Note that items without a date will be put last
2 POST /todo/items Create a new to-do-item
3 GET /todo/items/{itemId} Get a single unfinished item of current user. Throw an error if no item found
4 POST /todo/items/{itemId} Update a to-do-item
5 POST /todo/items/{itemId}/finish Finish a to-do-item

token

Index Method Path Summary
1 POST /token/delete logout
2 POST /token/new/by-random-code/local OAuth2 Token Endpoint. login with a random login code for local users
3 POST /token/new/by-register/local OAuth2 Token Endpoint. local user registers
4 POST /token/new/local OAuth2 Token Endpoint. login if the user's account is registered here instead of being an social account(google, facebook etc.)
5 POST /token/new/social/by-auth-code/{source}/{clientType} OAuth2 Token Endpoint. login with social sites authorization code. The backend will exchange the code for access token, and extracts the user's email. This is mainly used for desktop clients and web clients. Note that you must set up social clientId/clientSecret on the backend, and set up social clientId on the client side
6 POST /token/new/social/by-token/{source}/{clientType} OAuth2 Token Endpoint. login with social sites's token. The backend will verify this token and obtain the user's email. Mainly used for mobile clients which can obtain token directly.
7 POST /token/random-code/new/local generate a random login code
8 POST /token/refresh OAuth2 Refresh Token
9 GET /token/test/protected-resource A test resource only accessible by login-ed users. Feel free to delete it

user

Index Method Path Summary
1 POST /user/email-verification-process/new Start an email verification process. After calling this the user will receive an email containing the verificaiton link
2 GET /user/email-verification-process/verify Do email verification. Note this is not really a typical restful call. It always returns plain text
3 POST /user/password/forget-password-flow/update The final step of the forget-password-flow: reset password
4 POST /user/password/forget-password-verify-code/new Start a 'forget-password' process. After calling this the user will receive an email containing a verification code for him to reset password
5 POST /user/password/forget-password-verify-code/validate Call this endpoint to validate the verification code user received in their email
6 POST /user/password/update/local change password for local accounts
7 GET /user/profile/me Get the profile of the current user

todo

GET /todo/items

Summary Get all unfinished items of current user. It will sort by date asc. Note that items without a date will be put last
Notes
Consumes application/json
Produces application/json

Parameters

Name Parameter Type Data Type Required Description
Authorization header
string
Y OAuth2 access token such as 'Bearer xxx'
clientCurrentDateTime header
string
Y Current local date time in client (no timezone). The format is like '2011-12-03T10:15:30'

Responses

HTTP Status Code Reason Response Type
200 success
array[ToDoItem]
Property Type Description Format Required ReadOnly
[].id int64 the record's id in backend's db int64 Y
[].createdAt datetime create time. The system miliseconds since Jan.1 1970 GMT date-time Y
[].updatedAt datetime last update time. The system miliseconds since Jan.1 1970 GMT date-time Y
[].userId int64 int64 Y
[].task string The task. Max length is 200 Y
[].moreInfo string N
[].date string Date (no time part) to do it or the start date for a serial task, no timezone. Json format is yyyy-MM-dd date N
[].nextDate string Next date to do this task (could be today). This is for serial tasks only. Json format is yyyy-MM-dd date N
[].finished boolean Y
[].repeatStrategy RepeatStrategy N
[].repeatStrategy.repeatMode string One of PERIOD, DAYS_OF_WEEK and DAY_IN_MONTH Y
[].repeatStrategy.modeDetail RepeatModeDetail The details of the repeating mode Y
[].type string Y
460 biz error
ErrorResult
Property Type Description Format Required ReadOnly
error string Error code. Compatible with OAuth2 N
error_description string Error message for client developers to read. Not for users. Compatible with OAuth2 N
exception_id string exception Id. Please send this to the backend developer for troubleshooting N
non_field_error_for_user string Imagine there is a form, this is the error shown on top of the form, unrelated to any specific field N
field_errors_for_user object Imagine there is a form, this is the error shown beside the input fields N
error_description_for_user string Error message that can be shown to users. It's derived from non_field_error_for_user and field_errors_for_user N Y

POST /todo/items

Summary Create a new to-do-item
Notes
Consumes application/json
Produces application/json

Parameters

Name Parameter Type Data Type Required Description
body body
NewToDoItemRequest
Property Type Description Format Required ReadOnly
task string task Y
date string Date (no time part) to do it or the start date for a serial task, no timezone. Json format is yyyy-MM-dd date N
moreInfo string moreInfo N
repeatStrategy RepeatStrategy temp N
repeatStrategy.repeatMode string One of PERIOD, DAYS_OF_WEEK and DAY_IN_MONTH Y
repeatStrategy.modeDetail RepeatModeDetail The details of the repeating mode Y
N
Authorization header
string
Y OAuth2 access token such as 'Bearer xxx'

Responses

HTTP Status Code Reason Response Type
200 success
ToDoItem
Property Type Description Format Required ReadOnly
id int64 the record's id in backend's db int64 Y
createdAt datetime create time. The system miliseconds since Jan.1 1970 GMT date-time Y
updatedAt datetime last update time. The system miliseconds since Jan.1 1970 GMT date-time Y
userId int64 int64 Y
task string The task. Max length is 200 Y
moreInfo string N
date string Date (no time part) to do it or the start date for a serial task, no timezone. Json format is yyyy-MM-dd date N
nextDate string Next date to do this task (could be today). This is for serial tasks only. Json format is yyyy-MM-dd date N
finished boolean Y
repeatStrategy RepeatStrategy N
repeatStrategy.repeatMode string One of PERIOD, DAYS_OF_WEEK and DAY_IN_MONTH Y
repeatStrategy.modeDetail RepeatModeDetail The details of the repeating mode Y
type string Y
460 biz error
ErrorResult
Property Type Description Format Required ReadOnly
error string Error code. Compatible with OAuth2 N
error_description string Error message for client developers to read. Not for users. Compatible with OAuth2 N
exception_id string exception Id. Please send this to the backend developer for troubleshooting N
non_field_error_for_user string Imagine there is a form, this is the error shown on top of the form, unrelated to any specific field N
field_errors_for_user object Imagine there is a form, this is the error shown beside the input fields N
error_description_for_user string Error message that can be shown to users. It's derived from non_field_error_for_user and field_errors_for_user N Y

GET /todo/items/{itemId}

Summary Get a single unfinished item of current user. Throw an error if no item found
Notes
Consumes application/json
Produces application/json

Parameters

Name Parameter Type Data Type Required Description
itemId path
int64
Y
Authorization header
string
Y OAuth2 access token such as 'Bearer xxx'

Responses

HTTP Status Code Reason Response Type
200 success
ToDoItem
Property Type Description Format Required ReadOnly
id int64 the record's id in backend's db int64 Y
createdAt datetime create time. The system miliseconds since Jan.1 1970 GMT date-time Y
updatedAt datetime last update time. The system miliseconds since Jan.1 1970 GMT date-time Y
userId int64 int64 Y
task string The task. Max length is 200 Y
moreInfo string N
date string Date (no time part) to do it or the start date for a serial task, no timezone. Json format is yyyy-MM-dd date N
nextDate string Next date to do this task (could be today). This is for serial tasks only. Json format is yyyy-MM-dd date N
finished boolean Y
repeatStrategy RepeatStrategy N
repeatStrategy.repeatMode string One of PERIOD, DAYS_OF_WEEK and DAY_IN_MONTH Y
repeatStrategy.modeDetail RepeatModeDetail The details of the repeating mode Y
type string Y
460 biz error
ErrorResult
Property Type Description Format Required ReadOnly
error string Error code. Compatible with OAuth2 N
error_description string Error message for client developers to read. Not for users. Compatible with OAuth2 N
exception_id string exception Id. Please send this to the backend developer for troubleshooting N
non_field_error_for_user string Imagine there is a form, this is the error shown on top of the form, unrelated to any specific field N
field_errors_for_user object Imagine there is a form, this is the error shown beside the input fields N
error_description_for_user string Error message that can be shown to users. It's derived from non_field_error_for_user and field_errors_for_user N Y

POST /todo/items/{itemId}

Summary Update a to-do-item
Notes
Consumes application/json
Produces application/json

Parameters

Name Parameter Type Data Type Required Description
itemId path
int64
Y
body body
UpdateToDoItemRequest
Property Type Description Format Required ReadOnly
task string task Y
date string Date (no time part) to do it or the start date for a serial task, no timezone. Json format is yyyy-MM-dd date N
moreInfo string moreInfo N
repeatStrategy RepeatStrategy temp N
repeatStrategy.repeatMode string One of PERIOD, DAYS_OF_WEEK and DAY_IN_MONTH Y
repeatStrategy.modeDetail RepeatModeDetail The details of the repeating mode Y
N
Authorization header
string
Y OAuth2 access token such as 'Bearer xxx'

Responses

HTTP Status Code Reason Response Type
200 success
ToDoItem
Property Type Description Format Required ReadOnly
id int64 the record's id in backend's db int64 Y
createdAt datetime create time. The system miliseconds since Jan.1 1970 GMT date-time Y
updatedAt datetime last update time. The system miliseconds since Jan.1 1970 GMT date-time Y
userId int64 int64 Y
task string The task. Max length is 200 Y
moreInfo string N
date string Date (no time part) to do it or the start date for a serial task, no timezone. Json format is yyyy-MM-dd date N
nextDate string Next date to do this task (could be today). This is for serial tasks only. Json format is yyyy-MM-dd date N
finished boolean Y
repeatStrategy RepeatStrategy N
repeatStrategy.repeatMode string One of PERIOD, DAYS_OF_WEEK and DAY_IN_MONTH Y
repeatStrategy.modeDetail RepeatModeDetail The details of the repeating mode Y
type string Y
460 biz error
ErrorResult
Property Type Description Format Required ReadOnly
error string Error code. Compatible with OAuth2 N
error_description string Error message for client developers to read. Not for users. Compatible with OAuth2 N
exception_id string exception Id. Please send this to the backend developer for troubleshooting N
non_field_error_for_user string Imagine there is a form, this is the error shown on top of the form, unrelated to any specific field N
field_errors_for_user object Imagine there is a form, this is the error shown beside the input fields N
error_description_for_user string Error message that can be shown to users. It's derived from non_field_error_for_user and field_errors_for_user N Y

POST /todo/items/{itemId}/finish

Summary Finish a to-do-item
Notes
Consumes application/json
Produces application/json

Parameters

Name Parameter Type Data Type Required Description
itemId path
int64
Y
Authorization header
string
Y OAuth2 access token such as 'Bearer xxx'

Responses

HTTP Status Code Reason Response Type
200 success
460 biz error
ErrorResult
Property Type Description Format Required ReadOnly
error string Error code. Compatible with OAuth2 N
error_description string Error message for client developers to read. Not for users. Compatible with OAuth2 N
exception_id string exception Id. Please send this to the backend developer for troubleshooting N
non_field_error_for_user string Imagine there is a form, this is the error shown on top of the form, unrelated to any specific field N
field_errors_for_user object Imagine there is a form, this is the error shown beside the input fields N
error_description_for_user string Error message that can be shown to users. It's derived from non_field_error_for_user and field_errors_for_user N Y

token

POST /token/delete

Summary logout
Notes
Consumes application/json
Produces application/json

Parameters

Name Parameter Type Data Type Required Description
Authorization header
string
Y OAuth2 access token such as 'Bearer xxx'

Responses

HTTP Status Code Reason Response Type
200 success

POST /token/new/by-random-code/local

Summary OAuth2 Token Endpoint. login with a random login code for local users
Notes It conforms to standard OAuth 2.0 protocol with grant_type = password without validating client credentials.
Consumes application/x-www-form-urlencoded
Produces application/json

Parameters

Name Parameter Type Data Type Required Description
grant_type formData
string
Y OAuth2 grant type. It has to be 'password'
username formData
string
Y The user's email
password formData
string
Y The random login code

Responses

HTTP Status Code Reason Response Type
200 success
AuthTokenResult
Property Type Description Format Required ReadOnly
access_token string access_token N
refresh_token string refresh_token N
expires_in int64 expires_in int64 N
token_type string token_type N
user_principal string user_principal N
400 oauth2 token endpoint error
ErrorResult
Property Type Description Format Required ReadOnly
error string Error code. Compatible with OAuth2 N
error_description string Error message for client developers to read. Not for users. Compatible with OAuth2 N
exception_id string exception Id. Please send this to the backend developer for troubleshooting N
non_field_error_for_user string Imagine there is a form, this is the error shown on top of the form, unrelated to any specific field N
field_errors_for_user object Imagine there is a form, this is the error shown beside the input fields N
error_description_for_user string Error message that can be shown to users. It's derived from non_field_error_for_user and field_errors_for_user N Y

POST /token/new/by-register/local

Summary OAuth2 Token Endpoint. local user registers
Notes It conforms to standard OAuth 2.0 protocol with grant_type = password without validating client credentials.
Consumes application/x-www-form-urlencoded
Produces application/json

Parameters

Name Parameter Type Data Type Required Description
grant_type formData
string
Y OAuth2 grant type. It has to be 'password'
username formData
string
Y email
password formData
string
Y password

Responses

HTTP Status Code Reason Response Type
200 success
AuthTokenResult
Property Type Description Format Required ReadOnly
access_token string access_token N
refresh_token string refresh_token N
expires_in int64 expires_in int64 N
token_type string token_type N
user_principal string user_principal N
400 oauth2 token endpoint error
ErrorResult
Property Type Description Format Required ReadOnly
error string Error code. Compatible with OAuth2 N
error_description string Error message for client developers to read. Not for users. Compatible with OAuth2 N
exception_id string exception Id. Please send this to the backend developer for troubleshooting N
non_field_error_for_user string Imagine there is a form, this is the error shown on top of the form, unrelated to any specific field N
field_errors_for_user object Imagine there is a form, this is the error shown beside the input fields N
error_description_for_user string Error message that can be shown to users. It's derived from non_field_error_for_user and field_errors_for_user N Y

POST /token/new/local

Summary OAuth2 Token Endpoint. login if the user's account is registered here instead of being an social account(google, facebook etc.)
Notes It conforms to standard OAuth 2.0 protocol with grant_type = password without validating client credentials.
Consumes application/x-www-form-urlencoded
Produces application/json

Parameters

Name Parameter Type Data Type Required Description
grant_type formData
string
Y OAuth2 grant type. It has to be 'password'
username formData
string
Y The user's email
password formData
string
Y The user's password
long_session formData
boolean
Y if true, the token will be available for a relatively long time

Responses

HTTP Status Code Reason Response Type
200 success
AuthTokenResult
Property Type Description Format Required ReadOnly
access_token string access_token N
refresh_token string refresh_token N
expires_in int64 expires_in int64 N
token_type string token_type N
user_principal string user_principal N
400 oauth2 token endpoint error
ErrorResult
Property Type Description Format Required ReadOnly
error string Error code. Compatible with OAuth2 N
error_description string Error message for client developers to read. Not for users. Compatible with OAuth2 N
exception_id string exception Id. Please send this to the backend developer for troubleshooting N
non_field_error_for_user string Imagine there is a form, this is the error shown on top of the form, unrelated to any specific field N
field_errors_for_user object Imagine there is a form, this is the error shown beside the input fields N
error_description_for_user string Error message that can be shown to users. It's derived from non_field_error_for_user and field_errors_for_user N Y

POST /token/new/social/by-auth-code/{source}/{clientType}

Summary OAuth2 Token Endpoint. login with social sites authorization code. The backend will exchange the code for access token, and extracts the user's email. This is mainly used for desktop clients and web clients. Note that you must set up social clientId/clientSecret on the backend, and set up social clientId on the client side
Notes It conforms to standard OAuth 2.0 protocol with grant_type = password without validating client credentials.
Consumes application/x-www-form-urlencoded
Produces application/json

Parameters

Name Parameter Type Data Type Required Description
source path
string
Y Currently it supports: 'google' and 'facebook' .
clientType path
string
Y The client type, including 'desktop', 'web' and 'mobile'.
grant_type formData
string
Y OAuth2 grant type. It has to be 'password'
username formData
string
Y The authorization code you obtained from social sites after an OAuth2 code flow with them
password formData
string
Y anything but null
long_session formData
boolean
Y if true, the token will be available for a relatively long time
redirectUri formData
string
Y The redirect uri for this social login. 1. For google + desktop, it CAN be 'urn:ietf:wg:oauth:2.0:oob' 2. For google + web, it MUST be 'postmessage' 3. For facebook + desktop, it CAN be 'https://www.facebook.com/connect/login_success.html' 4. For facebook + web, it is a url of your html client

Responses

HTTP Status Code Reason Response Type
200 success
AuthTokenResult
Property Type Description Format Required ReadOnly
access_token string access_token N
refresh_token string refresh_token N
expires_in int64 expires_in int64 N
token_type string token_type N
user_principal string user_principal N
400 oauth2 token endpoint error
ErrorResult
Property Type Description Format Required ReadOnly
error string Error code. Compatible with OAuth2 N
error_description string Error message for client developers to read. Not for users. Compatible with OAuth2 N
exception_id string exception Id. Please send this to the backend developer for troubleshooting N
non_field_error_for_user string Imagine there is a form, this is the error shown on top of the form, unrelated to any specific field N
field_errors_for_user object Imagine there is a form, this is the error shown beside the input fields N
error_description_for_user string Error message that can be shown to users. It's derived from non_field_error_for_user and field_errors_for_user N Y

POST /token/new/social/by-token/{source}/{clientType}

Summary OAuth2 Token Endpoint. login with social sites's token. The backend will verify this token and obtain the user's email. Mainly used for mobile clients which can obtain token directly.
Notes It conforms to standard OAuth 2.0 protocol with grant_type = password without validating client credentials.
Consumes application/x-www-form-urlencoded
Produces application/json

Parameters

Name Parameter Type Data Type Required Description
source path
string
Y Currently it supports: 'google' and 'facebook' .For google, plaease pass the id token; for facebook, please pass the access token
clientType path
string
Y The client type, including 'desktop', 'web' and 'mobile'.
grant_type formData
string
Y OAuth2 grant type. It has to be 'password'
username formData
string
Y The access token you obtained after logining into Facebook. The token should have the scope of 'email'
password formData
string
Y Anything but null
long_session formData
boolean
Y if true, the token will be available for a relatively long time

Responses

HTTP Status Code Reason Response Type
200 success
AuthTokenResult
Property Type Description Format Required ReadOnly
access_token string access_token N
refresh_token string refresh_token N
expires_in int64 expires_in int64 N
token_type string token_type N
user_principal string user_principal N
400 oauth2 token endpoint error
ErrorResult
Property Type Description Format Required ReadOnly
error string Error code. Compatible with OAuth2 N
error_description string Error message for client developers to read. Not for users. Compatible with OAuth2 N
exception_id string exception Id. Please send this to the backend developer for troubleshooting N
non_field_error_for_user string Imagine there is a form, this is the error shown on top of the form, unrelated to any specific field N
field_errors_for_user object Imagine there is a form, this is the error shown beside the input fields N
error_description_for_user string Error message that can be shown to users. It's derived from non_field_error_for_user and field_errors_for_user N Y

POST /token/random-code/new/local

Summary generate a random login code
Notes
Consumes application/json
Produces application/json

Parameters

Name Parameter Type Data Type Required Description
body body
GenRandomLoginCodeRequest
Property Type Description Format Required ReadOnly
email string the user's email Y
N

Responses

HTTP Status Code Reason Response Type
200 success
460 biz error
ErrorResult
Property Type Description Format Required ReadOnly
error string Error code. Compatible with OAuth2 N
error_description string Error message for client developers to read. Not for users. Compatible with OAuth2 N
exception_id string exception Id. Please send this to the backend developer for troubleshooting N
non_field_error_for_user string Imagine there is a form, this is the error shown on top of the form, unrelated to any specific field N
field_errors_for_user object Imagine there is a form, this is the error shown beside the input fields N
error_description_for_user string Error message that can be shown to users. It's derived from non_field_error_for_user and field_errors_for_user N Y

POST /token/refresh

Summary OAuth2 Refresh Token
Notes the refresh token will be invalid once used
Consumes application/x-www-form-urlencoded
Produces application/json

Parameters

Name Parameter Type Data Type Required Description
grant_type formData
string
Y must be 'refresh_token'
refresh_token formData
string
Y The refresh token

Responses

HTTP Status Code Reason Response Type
200 success
AuthTokenResult
Property Type Description Format Required ReadOnly
access_token string access_token N
refresh_token string refresh_token N
expires_in int64 expires_in int64 N
token_type string token_type N
user_principal string user_principal N
400 oauth2 token endpoint error
ErrorResult
Property Type Description Format Required ReadOnly
error string Error code. Compatible with OAuth2 N
error_description string Error message for client developers to read. Not for users. Compatible with OAuth2 N
exception_id string exception Id. Please send this to the backend developer for troubleshooting N
non_field_error_for_user string Imagine there is a form, this is the error shown on top of the form, unrelated to any specific field N
field_errors_for_user object Imagine there is a form, this is the error shown beside the input fields N
error_description_for_user string Error message that can be shown to users. It's derived from non_field_error_for_user and field_errors_for_user N Y

GET /token/test/protected-resource

Summary A test resource only accessible by login-ed users. Feel free to delete it
Notes
Consumes application/json
Produces application/json

Parameters

Name Parameter Type Data Type Required Description
Authorization header
string
Y OAuth2 access token such as 'Bearer xxx'

Responses

HTTP Status Code Reason Response Type
200 success

user

POST /user/email-verification-process/new

Summary Start an email verification process. After calling this the user will receive an email containing the verificaiton link
Notes
Consumes application/json
Produces application/json

Parameters

Name Parameter Type Data Type Required Description
Authorization header
string
Y OAuth2 access token such as 'Bearer xxx'

Responses

HTTP Status Code Reason Response Type
200 success
460 biz error
ErrorResult
Property Type Description Format Required ReadOnly
error string Error code. Compatible with OAuth2 N
error_description string Error message for client developers to read. Not for users. Compatible with OAuth2 N
exception_id string exception Id. Please send this to the backend developer for troubleshooting N
non_field_error_for_user string Imagine there is a form, this is the error shown on top of the form, unrelated to any specific field N
field_errors_for_user object Imagine there is a form, this is the error shown beside the input fields N
error_description_for_user string Error message that can be shown to users. It's derived from non_field_error_for_user and field_errors_for_user N Y

GET /user/email-verification-process/verify

Summary Do email verification. Note this is not really a typical restful call. It always returns plain text
Notes
Consumes text/plain
Produces text/plain

Parameters

Name Parameter Type Data Type Required Description
d query
string
N

Responses

HTTP Status Code Reason Response Type
200 success
string
460 biz error
string

POST /user/password/forget-password-flow/update

Summary The final step of the forget-password-flow: reset password
Notes
Consumes application/json
Produces application/json

Parameters

Name Parameter Type Data Type Required Description
body body
ResetPasswordRequest
Property Type Description Format Required ReadOnly
email string Y
verifyCode string Y
newPassword string new password Y
N

Responses

HTTP Status Code Reason Response Type
200 success
460 biz error
ErrorResult
Property Type Description Format Required ReadOnly
error string Error code. Compatible with OAuth2 N
error_description string Error message for client developers to read. Not for users. Compatible with OAuth2 N
exception_id string exception Id. Please send this to the backend developer for troubleshooting N
non_field_error_for_user string Imagine there is a form, this is the error shown on top of the form, unrelated to any specific field N
field_errors_for_user object Imagine there is a form, this is the error shown beside the input fields N
error_description_for_user string Error message that can be shown to users. It's derived from non_field_error_for_user and field_errors_for_user N Y

POST /user/password/forget-password-verify-code/new

Summary Start a 'forget-password' process. After calling this the user will receive an email containing a verification code for him to reset password
Notes
Consumes application/json
Produces application/json

Parameters

Name Parameter Type Data Type Required Description
body body
GenForgetPasswordVerifyRequest
Property Type Description Format Required ReadOnly
email string Y
N

Responses

HTTP Status Code Reason Response Type
200 success
460 biz error
ErrorResult
Property Type Description Format Required ReadOnly
error string Error code. Compatible with OAuth2 N
error_description string Error message for client developers to read. Not for users. Compatible with OAuth2 N
exception_id string exception Id. Please send this to the backend developer for troubleshooting N
non_field_error_for_user string Imagine there is a form, this is the error shown on top of the form, unrelated to any specific field N
field_errors_for_user object Imagine there is a form, this is the error shown beside the input fields N
error_description_for_user string Error message that can be shown to users. It's derived from non_field_error_for_user and field_errors_for_user N Y

POST /user/password/forget-password-verify-code/validate

Summary Call this endpoint to validate the verification code user received in their email
Notes
Consumes application/json
Produces application/json

Parameters

Name Parameter Type Data Type Required Description
body body
FoValidateForgetPasswordVerifyCodeRequest
Property Type Description Format Required ReadOnly
email string Y
verifyCode string Y
N

Responses

HTTP Status Code Reason Response Type
200 success
460 biz error
ErrorResult
Property Type Description Format Required ReadOnly
error string Error code. Compatible with OAuth2 N
error_description string Error message for client developers to read. Not for users. Compatible with OAuth2 N
exception_id string exception Id. Please send this to the backend developer for troubleshooting N
non_field_error_for_user string Imagine there is a form, this is the error shown on top of the form, unrelated to any specific field N
field_errors_for_user object Imagine there is a form, this is the error shown beside the input fields N
error_description_for_user string Error message that can be shown to users. It's derived from non_field_error_for_user and field_errors_for_user N Y

POST /user/password/update/local

Summary change password for local accounts
Notes
Consumes application/json
Produces application/json

Parameters

Name Parameter Type Data Type Required Description
body body
ChangePasswordRequest
Property Type Description Format Required ReadOnly
currentPassword string current password Y
newPassword string new password Y
N
Authorization header
string
Y OAuth2 access token such as 'Bearer xxx'

Responses

HTTP Status Code Reason Response Type
200 success
460 biz error
ErrorResult
Property Type Description Format Required ReadOnly
error string Error code. Compatible with OAuth2 N
error_description string Error message for client developers to read. Not for users. Compatible with OAuth2 N
exception_id string exception Id. Please send this to the backend developer for troubleshooting N
non_field_error_for_user string Imagine there is a form, this is the error shown on top of the form, unrelated to any specific field N
field_errors_for_user object Imagine there is a form, this is the error shown beside the input fields N
error_description_for_user string Error message that can be shown to users. It's derived from non_field_error_for_user and field_errors_for_user N Y

GET /user/profile/me

Summary Get the profile of the current user
Notes
Consumes application/json
Produces application/json

Parameters

Name Parameter Type Data Type Required Description
Authorization header
string
Y OAuth2 access token such as 'Bearer xxx'

Responses

HTTP Status Code Reason Response Type
200 success
User
Property Type Description Format Required ReadOnly
id int64 the record's id in backend's db int64 Y
createdAt datetime create time. The system miliseconds since Jan.1 1970 GMT date-time Y
updatedAt datetime last update time. The system miliseconds since Jan.1 1970 GMT date-time Y
principal string Y
source string source, like 'local' or 'google' Y
email string Y
emailVerified boolean Y
canVerifyEmail boolean Y Y
460 biz error
ErrorResult
Property Type Description Format Required ReadOnly
error string Error code. Compatible with OAuth2 N
error_description string Error message for client developers to read. Not for users. Compatible with OAuth2 N
exception_id string exception Id. Please send this to the backend developer for troubleshooting N
non_field_error_for_user string Imagine there is a form, this is the error shown on top of the form, unrelated to any specific field N
field_errors_for_user object Imagine there is a form, this is the error shown beside the input fields N
error_description_for_user string Error message that can be shown to users. It's derived from non_field_error_for_user and field_errors_for_user N Y