Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add User Session blueprint and Create method #25

Merged
merged 4 commits into from
Oct 1, 2016
Merged
Show file tree
Hide file tree
Changes from 3 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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ PATCH /accounts/{id}
DELETE /accounts/{id}
GET /accounts/{id}/profile
PATCH /accounts/{id}/profile
POST /accounts/{id}/sessions
```

Find the full spec at http://docs.accountjsonapi.apiary.io
Expand Down
64 changes: 64 additions & 0 deletions apiary.apib
Original file line number Diff line number Diff line change
Expand Up @@ -1253,3 +1253,67 @@ All custom user data is stored in the profile.
"detail": "'type' and 'id' provided don't match any existing document"
}]
}

## User Session [/accounts/{id}/sessions]

Admins can manage sessions for all user accounts

+ Parameters

+ id: abc4567 (required, string) - id of account

### Create [POST]

+ Request

+ Headers

Accept: application/vnd.api+json
Authorization: Bearer sessionid123

+ Response 201 (application/vnd.api+json)

{
"links": {
"self": "https://example.com/accounts/abcd123/sessions/session123"
},
"data": {
"id": "session123",
"type": "session",
"account": {
"id": "abcd123",
"username": "[email protected]"
}
},
"relationships": {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hoping I did this one right

"account": {
"links": {
"related": "https://example.com/accounts/abcd123"
},
"data": {
"id": "abcd123",
"type": "account"
}
}
}
}

+ Response 401 (application/vnd.api+json)

{
errors: [{
"status": "401",
"title": "Unauthorized",
"detail": "Authorization header missing"
}]
}

+ Response 401 (application/vnd.api+json)

{
errors: [{
"status": "401",
"title": "Unauthorized",
"detail": "Session invalid"
}]
}