Repository navigation
Issue #221 added api/v1/users documentation - #224
Conversation
added api/v1/users documentation
hpjaj
left a comment
There was a problem hiding this comment.
Coming along really nicely 👍
|
|
||
| API endpoints that Operation Code's Rails backend makes available to its React frontend. | ||
|
|
||
| ## Users | Create [/api/v1/users{?first_name,last_name,email,zip,password,mentor}] |
There was a problem hiding this comment.
Can you please alphabetize the placement of these in the file. First by model (i.e. User), then by action (i.e. create)
There was a problem hiding this comment.
Done, also adjusted Location
| + Body | ||
|
|
||
| { | ||
| first_name: "Mike", |
There was a problem hiding this comment.
Can you pls add indenting in keeping with other Body hashes
| + Response 201 (application/json) | ||
|
|
||
| { | ||
| token: Bearer Access-Token |
| + Response 422 (application/json) | ||
|
|
||
| { | ||
| errors: "Some error message" |
| + Body | ||
|
|
||
| { | ||
| verified: true |
There was a problem hiding this comment.
Removed verified from both header and body, and fixed indentation.
|
|
||
| + Parameters | ||
|
|
||
| + education_level (string, required) - Users highest level of education in the form of a string |
There was a problem hiding this comment.
These are all optional (vs. required)
There was a problem hiding this comment.
So if they submit no params it returns a 422 or 200?
| last_name: "Johnson", | ||
| email: "dreams@operationcode.org", | ||
| zip: "80020", | ||
| password: "hunter2", |
There was a problem hiding this comment.
Technically encrypted_password is what is returned, but you can leave it out all together.
|
|
||
| + verified (boolean, required) - Users verified veteran status in the form of a boolean | ||
|
|
||
| ### Modify User record verified status [POST] |
There was a problem hiding this comment.
Perhaps something like, "Verifies a user's military affiliation status through ID.me"
| + email (string, required) - Email of the User in the form of a string | ||
| + zip (string, required) - Zipcode of the User in the form of a string | ||
| + password (string, required) - Password of the User in the form on a string | ||
| + mentor (boolean, required) - Is User requesting mentor in the form of a boolean |
There was a problem hiding this comment.
I believe mentor is optional
There was a problem hiding this comment.
I think you're right from a front end perspective.
…removed verified in header.
|
Completed changes you requested. One thing I noticed was how some of the endpoints had combined grouping. Codeschool | Show or Delete is one example. There's inconsistent use of Body in the previous documentation. But apiary doesn't seem to mind. Not sure of your thoughts. |
| + Body | ||
|
|
||
| { | ||
| first_name: "Mike", |
|
|
||
| + Parameters | ||
|
|
||
| + verified (boolean, required) - User has verified military affiliation status through ID.me |
| + Body | ||
|
|
||
| { | ||
| verified: true |
There was a problem hiding this comment.
Body is only the access_token
|
|
||
| ## Location | Delete [/api/v1/code_schools/:code_school_id/locations/:id] | ||
|
|
||
| ### Delete an Existing Location [DELETE] |
|
|
||
| + Headers | ||
|
|
||
| Authorization: Bearer Access-Token |
There was a problem hiding this comment.
This method actually does not require authorization. Only the update method does.
|
Made some changes, also found some instances where Param items only had 2 spaces. |
Description of changes
Included 3 new Apiary API routes.
POST
api/v1/users_controller#createPATCH
api/v1/users_controller#updatePOST for
api/v1/users_controller#verifyIssue Resolved
Resolved issue of lacking API docs for users.
Fixes #221