Skip to content

Commit

Permalink
feat: POST /accounts/{id}/sessions (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
barretodaniel authored and gr2m committed Oct 1, 2016
1 parent ad974c5 commit 3e0709a
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 0 deletions.
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
60 changes: 60 additions & 0 deletions apiary.apib
Original file line number Diff line number Diff line change
Expand Up @@ -1253,3 +1253,63 @@ 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",
"relationships": {
"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"
}]
}

0 comments on commit 3e0709a

Please sign in to comment.