2.2.1 • Published 10 years ago

account-json-api v2.2.1

Weekly downloads
6
License
ISC
Repository
github
Last release
10 years ago

account-json-api

RESTful JSON API-blueprint for all things user accounts

NPM version Build Status

This is a JSON API v1.0 compliant specification for a generic REST API for all things user accounts.

Summary

PUT    /session
GET    /session
DELETE /session
PUT    /session/account
GET    /session/account
PATCH  /session/account
DELETE /session/account
GET    /session/account/profile
PATCH  /session/account/profile

# Password resets, upgrades, etc.
GET    /requests
POST   /requests
GET    /requests/{id}
DELETE /requests/{id}

# Admin only
POST   /accounts
GET    /accounts
GET    /accounts/{id}
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

Example

Request

PUT /session
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
{
    "data": {
        "type": "session",
        "attributes": {
            "username": "john-doe",
            "password": "secret"
        }
    }
}

Response

{
    "links": {
        "self": "https://example.com/session"
    },
    "data": {
        "id": "sessionid123",
        "type": "session",
        "relationships": {
            "account": {
                "links": {
                    "related": "https://example.com/session/account"
                },
                "data": {
                    "id": "abc1234",
                    "type": "account"
                }
            }
        }
    },
    "included": [{
        "id": "abc1234",
        "type": "account",
        "attributes": {
            "username": "jane-doe"
        },
        "relationships": {
            "profile": {
                "links": {
                    "related": "https://example.com/session/account/profile"
                },
                "data": {
                    "id": "abc1234-profile",
                    "type": "accountProfile"
                }
            }
        }
    }]
}

Implementations

The account-json-api is currently being implemented by Hoodie in the hoodie-server-account module.

License

MIT

2.2.1

10 years ago

2.2.0

10 years ago

2.1.0

10 years ago

2.0.1

10 years ago

2.0.0

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago