|
|
@ -1,6 +1,57 @@ |
|
|
|
User API |
|
|
|
======== |
|
|
|
|
|
|
|
.. http:get:: /user |
|
|
|
|
|
|
|
Get a page of users. |
|
|
|
|
|
|
|
**Example request** |
|
|
|
|
|
|
|
.. sourcecode:: http |
|
|
|
|
|
|
|
GET /user HTTP/1.1 |
|
|
|
Host: example.tld |
|
|
|
Accept: application/json |
|
|
|
Authorization: Token <Base64(user:userToken)> |
|
|
|
|
|
|
|
**Example response**: |
|
|
|
|
|
|
|
.. sourcecode:: http |
|
|
|
|
|
|
|
HTTP/1.1 200 OK |
|
|
|
Vary: Accept |
|
|
|
Content-Type: application/json |
|
|
|
|
|
|
|
{ |
|
|
|
"page": 1, |
|
|
|
"count": 1, |
|
|
|
"totalCount": 1, |
|
|
|
"lastPage": 1, |
|
|
|
"items" :[{ |
|
|
|
"creationTime": "2018-07-29T11:58:17-05:00", |
|
|
|
"lastLoginTime": "2018-07-29T12:43:27-05:00", |
|
|
|
"name": "atheneum_administrator", |
|
|
|
"role": "ADMIN", |
|
|
|
"version": 0 |
|
|
|
}] |
|
|
|
} |
|
|
|
|
|
|
|
:query int page: User page to retrieve |
|
|
|
:query int perPage: Number of records to retrieve per page (max 100) |
|
|
|
:<header Accept: Response content type depends on :mailheader:`Accept` header |
|
|
|
:<header Authorization: The encoded basic authorization |
|
|
|
:>header Content-Type: Depends on :mailheader:`Accept` header of request |
|
|
|
:>json int page: Page retrieved |
|
|
|
:>json int count: Number of items returned |
|
|
|
:>json int totalCount: Total number of items available |
|
|
|
:>json int lastPage: Last page that can be requested before 404 |
|
|
|
:>json int items: List of Users |
|
|
|
:statuscode 200: Successfully retrieved the user |
|
|
|
:statuscode 400: Invalid page or perPage values |
|
|
|
:statuscode 401: Authorization failed |
|
|
|
:statuscode 404: User page doesn't exist |
|
|
|
|
|
|
|
|
|
|
|
.. http:get:: /user/(str:user_name) |
|
|
|
|
|
|
|
Find a user by name. |
|
|
@ -30,12 +81,18 @@ User API |
|
|
|
"version": 0 |
|
|
|
} |
|
|
|
|
|
|
|
:reqheader Accept: the response content type depends on :mailheader:`Accept` header |
|
|
|
:reqheader Authorization: The encoded basic authorization |
|
|
|
:resheader Content-Type: this depends on :mailheader:`Accept` header of request |
|
|
|
:statuscode 200: successfully retrieved the user |
|
|
|
:statuscode 401: authorization failed |
|
|
|
:statuscode 404: user doesn't exist |
|
|
|
:param string user_name: Name of the user to retrieve information about |
|
|
|
:<header Accept: Response content type depends on :mailheader:`Accept` header |
|
|
|
:<header Authorization: The encoded basic authorization |
|
|
|
:>header Content-Type: Depends on :mailheader:`Accept` header of request |
|
|
|
:>json datetime creationTime: Creation time for the user |
|
|
|
:>json datetime lastLoginTime: When the user last logged in, or was last bumped |
|
|
|
:>json string name: The user name |
|
|
|
:>json string role: The role assigned to the user |
|
|
|
:>json int version: Version information |
|
|
|
:statuscode 200: Successfully retrieved the user |
|
|
|
:statuscode 401: Authorization failed |
|
|
|
:statuscode 404: User doesn't exist |
|
|
|
|
|
|
|
.. http:patch:: /user/(str:user_name) |
|
|
|
|
|
|
@ -72,16 +129,27 @@ User API |
|
|
|
"version": 1 |
|
|
|
} |
|
|
|
|
|
|
|
:reqheader Accept: the response content type depends on :mailheader:`Accept` header |
|
|
|
:reqheader Authorization: The encoded basic authorization |
|
|
|
:reqheader Content-Type: application/json |
|
|
|
:resheader Content-Type: this depends on :mailheader:`Accept` header of request |
|
|
|
:statuscode 200: successfully patched the user |
|
|
|
:statuscode 400: an issue in the payload was discovered |
|
|
|
:statuscode 401: authorization failed |
|
|
|
:statuscode 404: user doesn't exist |
|
|
|
|
|
|
|
.. http:post:: /user/ |
|
|
|
:param string user_name: Name of the user to update |
|
|
|
:<header Accept: Response content type depends on :mailheader:`Accept` header |
|
|
|
:<header Authorization: Encoded token authorization |
|
|
|
:<header Content-Type: application/json |
|
|
|
:<json datetime createDateTime: Update createDateTime (Administrator Only) |
|
|
|
:<json datetime lastLoginTime: Update lastLoginTime |
|
|
|
:<json string name: Update user name (Administrator Only) |
|
|
|
:<json string role: Update user role (Must be less than or equal to the role authenticating the action) |
|
|
|
:<json int version: Must match the latest version of the user |
|
|
|
:>header Content-Type: Depends on :mailheader:`Accept` header of request |
|
|
|
:>json datetime creationTime: Creation time for the user |
|
|
|
:>json datetime lastLoginTime: When the user last logged in, or was last bumped |
|
|
|
:>json string name: The user name |
|
|
|
:>json string role: The role assigned to the user |
|
|
|
:>json int version: Version information |
|
|
|
:statuscode 200: Successfully patched the user |
|
|
|
:statuscode 400: An issue in the payload was discovered |
|
|
|
:statuscode 401: Authorization failed |
|
|
|
:statuscode 404: User doesn't exist |
|
|
|
|
|
|
|
.. http:post:: /user |
|
|
|
|
|
|
|
Register a new user with the service. |
|
|
|
|
|
|
@ -89,7 +157,7 @@ User API |
|
|
|
|
|
|
|
.. sourcecode:: http |
|
|
|
|
|
|
|
POST /user/ HTTP/1.1 |
|
|
|
POST /user HTTP/1.1 |
|
|
|
Host: example.tld |
|
|
|
Accept: application/json |
|
|
|
Authorization: Token <Base64(user:userToken)> |
|
|
@ -116,13 +184,20 @@ User API |
|
|
|
"version": 0 |
|
|
|
} |
|
|
|
|
|
|
|
:reqheader Accept: the response content type depends on :mailheader:`Accept` header |
|
|
|
:reqheader Authorization: The encoded basic authorization |
|
|
|
:reqheader Content-Type: application/json |
|
|
|
:resheader Content-Type: this depends on :mailheader:`Accept` header of request |
|
|
|
:statuscode 200: successfully registered the user |
|
|
|
:statuscode 400: an issue in the payload was discovered |
|
|
|
:statuscode 401: authorization failed |
|
|
|
:<header Accept: Response content type depends on :mailheader:`Accept` header |
|
|
|
:<header Authorization: Encoded token authorization |
|
|
|
:<header Content-Type: application/json |
|
|
|
:<json string name: Name of the user |
|
|
|
:<json string password: Password to use |
|
|
|
:<json string role: Role to assign to the user (Must be less than or equal to the role of the authenticating user) |
|
|
|
:>header Content-Type: Depends on :mailheader:`Accept` header of request |
|
|
|
:>json datetime creationTime: Datetime the user was created |
|
|
|
:>json string name: Name of the created user |
|
|
|
:>json string role: Role of the created user |
|
|
|
:>json int version: Version number of the created user |
|
|
|
:statuscode 200: Successfully registered the user |
|
|
|
:statuscode 400: An issue in the payload was discovered |
|
|
|
:statuscode 401: Authorization failed |
|
|
|
|
|
|
|
.. http:delete:: /user/(str:user_name) |
|
|
|
|
|
|
@ -150,9 +225,12 @@ User API |
|
|
|
"success": true |
|
|
|
} |
|
|
|
|
|
|
|
:reqheader Accept: the response content type depends on :mailheader:`Accept` header |
|
|
|
:reqheader Authorization: The encoded basic authorization |
|
|
|
:resheader Content-Type: this depends on :mailheader:`Accept` header of request |
|
|
|
:statuscode 200: successfully deleted the user |
|
|
|
:statuscode 401: authorization failed |
|
|
|
:statuscode 404: user doesn't exist |
|
|
|
:param string user_name: Name of the user to delete |
|
|
|
:<header Accept: Response content type depends on :mailheader:`Accept` header |
|
|
|
:<header Authorization: Encoded token authorization |
|
|
|
:>header Content-Type: Depends on :mailheader:`Accept` header of request |
|
|
|
:>json string message: Success or failure message |
|
|
|
:>json boolean success: Action status indicator |
|
|
|
:statuscode 200: Successfully deleted the user |
|
|
|
:statuscode 401: Authorization failed |
|
|
|
:statuscode 404: User doesn't exist |