Skip to content
This repository was archived by the owner on Dec 3, 2019. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 46 additions & 1 deletion apiary.apib
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

{

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on these results from the params check you did in the controller:

<ActionController::Parameters {"user"=>{"email"=>"mekhi_kemmer@dooleycollier.info", "password"=>"pass123"}, "controller"=>"api/v1/sessions", "action"=>"create", "session"
=>{"user"=>{"email"=>"mekhi_kemmer@dooleycollier.info", "password"=>"pass123"}}, "format"=>"json"} permitted: false>

The request contains:

{"user"=>{"email"=>"mekhi_kemmer@dooleycollier.info", "password"=>"pass123"}}

So you'll want to update the Body and parameters sections accordingly.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed it to user, email and password

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]
Expand Down