| Base URL |
https://webapi.clumsytools.com/fo/rest |
| Version | 1.0-SNAPSHOT |
| Description |
|
| Contact Name | clumsy-tools-backend@gmail.com |
| 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 |
| 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 |
| 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 |
| 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 |
| 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' |
| HTTP Status Code | Reason | Response Type | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 200 | success |
array[ToDoItem]
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 460 | biz error |
ErrorResult
|
| Summary | Create a new to-do-item |
| Notes | |
| Consumes | application/json |
| Produces | application/json |
| Name | Parameter Type | Data Type | Required | Description | ||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| body | body |
NewToDoItemRequest
|
N | |||||||||||||||||||||||||||||||||||||||||||
| Authorization | header |
string
|
Y | OAuth2 access token such as 'Bearer xxx' |
| HTTP Status Code | Reason | Response Type | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 200 | success |
ToDoItem
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 460 | biz error |
ErrorResult
|
| Summary | Get a single unfinished item of current user. Throw an error if no item found |
| Notes | |
| Consumes | application/json |
| Produces | application/json |
| Name | Parameter Type | Data Type | Required | Description |
|---|---|---|---|---|
| itemId | path |
int64
|
Y | |
| Authorization | header |
string
|
Y | OAuth2 access token such as 'Bearer xxx' |
| HTTP Status Code | Reason | Response Type | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 200 | success |
ToDoItem
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 460 | biz error |
ErrorResult
|
| Summary | Update a to-do-item |
| Notes | |
| Consumes | application/json |
| Produces | application/json |
| Name | Parameter Type | Data Type | Required | Description | ||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| itemId | path |
int64
|
Y | |||||||||||||||||||||||||||||||||||||||||||
| body | body |
UpdateToDoItemRequest
|
N | |||||||||||||||||||||||||||||||||||||||||||
| Authorization | header |
string
|
Y | OAuth2 access token such as 'Bearer xxx' |
| HTTP Status Code | Reason | Response Type | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 200 | success |
ToDoItem
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 460 | biz error |
ErrorResult
|
| Summary | Finish a to-do-item |
| Notes | |
| Consumes | application/json |
| Produces | application/json |
| Name | Parameter Type | Data Type | Required | Description |
|---|---|---|---|---|
| itemId | path |
int64
|
Y | |
| Authorization | header |
string
|
Y | OAuth2 access token such as 'Bearer xxx' |
| HTTP Status Code | Reason | Response Type | ||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 200 | success | |||||||||||||||||||||||||||||||||||||||||||
| 460 | biz error |
ErrorResult
|
| Summary | logout |
| Notes | |
| Consumes | application/json |
| Produces | application/json |
| Name | Parameter Type | Data Type | Required | Description |
|---|---|---|---|---|
| Authorization | header |
string
|
Y | OAuth2 access token such as 'Bearer xxx' |
| HTTP Status Code | Reason | Response Type |
|---|---|---|
| 200 | success |
| 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 |
| 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 |
| HTTP Status Code | Reason | Response Type | ||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 200 | success |
AuthTokenResult
|
||||||||||||||||||||||||||||||||||||||||||
| 400 | oauth2 token endpoint error |
ErrorResult
|
| 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 |
| Name | Parameter Type | Data Type | Required | Description |
|---|---|---|---|---|
| grant_type | formData |
string
|
Y | OAuth2 grant type. It has to be 'password' |
| username | formData |
string
|
Y | |
| password | formData |
string
|
Y | password |
| HTTP Status Code | Reason | Response Type | ||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 200 | success |
AuthTokenResult
|
||||||||||||||||||||||||||||||||||||||||||
| 400 | oauth2 token endpoint error |
ErrorResult
|
| 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 |
| 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 |
| HTTP Status Code | Reason | Response Type | ||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 200 | success |
AuthTokenResult
|
||||||||||||||||||||||||||||||||||||||||||
| 400 | oauth2 token endpoint error |
ErrorResult
|
| 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 |
| 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 |
| HTTP Status Code | Reason | Response Type | ||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 200 | success |
AuthTokenResult
|
||||||||||||||||||||||||||||||||||||||||||
| 400 | oauth2 token endpoint error |
ErrorResult
|
| 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 |
| 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 |
| HTTP Status Code | Reason | Response Type | ||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 200 | success |
AuthTokenResult
|
||||||||||||||||||||||||||||||||||||||||||
| 400 | oauth2 token endpoint error |
ErrorResult
|
| Summary | generate a random login code |
| Notes | |
| Consumes | application/json |
| Produces | application/json |
| Name | Parameter Type | Data Type | Required | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| body | body |
GenRandomLoginCodeRequest
|
N |
| HTTP Status Code | Reason | Response Type | ||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 200 | success | |||||||||||||||||||||||||||||||||||||||||||
| 460 | biz error |
ErrorResult
|
| Summary | OAuth2 Refresh Token |
| Notes | the refresh token will be invalid once used |
| Consumes | application/x-www-form-urlencoded |
| Produces | application/json |
| Name | Parameter Type | Data Type | Required | Description |
|---|---|---|---|---|
| grant_type | formData |
string
|
Y | must be 'refresh_token' |
| refresh_token | formData |
string
|
Y | The refresh token |
| HTTP Status Code | Reason | Response Type | ||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 200 | success |
AuthTokenResult
|
||||||||||||||||||||||||||||||||||||||||||
| 400 | oauth2 token endpoint error |
ErrorResult
|
| Summary | A test resource only accessible by login-ed users. Feel free to delete it |
| Notes | |
| Consumes | application/json |
| Produces | application/json |
| Name | Parameter Type | Data Type | Required | Description |
|---|---|---|---|---|
| Authorization | header |
string
|
Y | OAuth2 access token such as 'Bearer xxx' |
| HTTP Status Code | Reason | Response Type |
|---|---|---|
| 200 | success |
| 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 |
| Name | Parameter Type | Data Type | Required | Description |
|---|---|---|---|---|
| Authorization | header |
string
|
Y | OAuth2 access token such as 'Bearer xxx' |
| HTTP Status Code | Reason | Response Type | ||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 200 | success | |||||||||||||||||||||||||||||||||||||||||||
| 460 | biz error |
ErrorResult
|
| 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 |
| Name | Parameter Type | Data Type | Required | Description |
|---|---|---|---|---|
| d | query |
string
|
N |
| HTTP Status Code | Reason | Response Type |
|---|---|---|
| 200 | success |
string
|
| 460 | biz error |
string
|
| Summary | The final step of the forget-password-flow: reset password |
| Notes | |
| Consumes | application/json |
| Produces | application/json |
| Name | Parameter Type | Data Type | Required | Description | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| body | body |
ResetPasswordRequest
|
N |
| HTTP Status Code | Reason | Response Type | ||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 200 | success | |||||||||||||||||||||||||||||||||||||||||||
| 460 | biz error |
ErrorResult
|
| 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 |
| Name | Parameter Type | Data Type | Required | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| body | body |
GenForgetPasswordVerifyRequest
|
N |
| HTTP Status Code | Reason | Response Type | ||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 200 | success | |||||||||||||||||||||||||||||||||||||||||||
| 460 | biz error |
ErrorResult
|
| Summary | Call this endpoint to validate the verification code user received in their email |
| Notes | |
| Consumes | application/json |
| Produces | application/json |
| Name | Parameter Type | Data Type | Required | Description | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| body | body |
FoValidateForgetPasswordVerifyCodeRequest
|
N |
| HTTP Status Code | Reason | Response Type | ||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 200 | success | |||||||||||||||||||||||||||||||||||||||||||
| 460 | biz error |
ErrorResult
|
| Summary | change password for local accounts |
| Notes | |
| Consumes | application/json |
| Produces | application/json |
| Name | Parameter Type | Data Type | Required | Description | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| body | body |
ChangePasswordRequest
|
N | |||||||||||||||||||
| Authorization | header |
string
|
Y | OAuth2 access token such as 'Bearer xxx' |
| HTTP Status Code | Reason | Response Type | ||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 200 | success | |||||||||||||||||||||||||||||||||||||||||||
| 460 | biz error |
ErrorResult
|
| Summary | Get the profile of the current user |
| Notes | |
| Consumes | application/json |
| Produces | application/json |
| Name | Parameter Type | Data Type | Required | Description |
|---|---|---|---|---|
| Authorization | header |
string
|
Y | OAuth2 access token such as 'Bearer xxx' |
| HTTP Status Code | Reason | Response Type | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 200 | success |
User
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 460 | biz error |
ErrorResult
|