diff --git a/apiary.apib b/apiary.apib index f84b3406..a5160b0e 100644 --- a/apiary.apib +++ b/apiary.apib @@ -719,7 +719,7 @@ API endpoints that Operation Code's Rails backend makes available to its React f + Response 400 (application/json) -## Resource [/api/v1/resources/{resource_id}] +## Resource | Show or Delete [/api/v1/resources/{resource_id}] + Parameters @@ -1017,6 +1017,51 @@ API endpoints that Operation Code's Rails backend makes available to its React f { errors: "Some error message" } +## Sessions | Create [/api/v1/sessions{?user,email,password}] ++ Parameters + + + user (object, required) - Object that wraps the user's attributes + + email (string, required) - The users email + + password (string, required) - The users password + +### Create a Session [POST] ++ Request (application/json) + + + Body + + { + user: { + email: "kennynagano@example.com", + password: "pass123" + } + } + + + ++ Response 201 (application/json) + + + Body + + { + "token" => some_long_string_of_characters, + "user" => { + "id" => 96, + "email" => "kennynagano@example.com", + "zip" => "97201", + "first_name" => "Keara", + "last_name" => "Runolfsson", + "slack_name" => "Jar Jar Binks", + "mentor" => false, + "verified" => false + }, + "redirect_to" => "/profile" + } + ++ Response 422 (application/json) + + { + errors: "Some error message" + } ## Slack User | Invite [/api/v1/slack_users]