Skip to content
Jeffrey N. Davis edited this page Feb 13, 2017 · 2 revisions

The Users resource is like virtually any other Users resource.

Index

$ curl -v "http://$BALAAM_URL/users"
[
  {
    "last_modified_at": "2017-02-12T22:30:04Z",
    "inserted_at": "2017-02-12T22:30:04Z",
    "username": "penland365",
    "id": 1
  },
    {
    "last_modified_at": "2017-02-12T22:30:04Z",
    "inserted_at": "2017-02-12T22:30:04Z",
    "username": "balaam",
    "id": 2
  }
]

Show

$ curl -v "http://$BALAAM_URL/users/1"
{
  "last_modified_at": "2017-02-12T22:30:04Z",
  "inserted_at": "2017-02-12T22:30:04Z",
  "username": "jeff",
  "id": 1
}

$ curl -v "http://$BALAAM_URL/users/jeff"
{
  "last_modified_at": "2017-02-12T22:30:04Z",
  "inserted_at": "2017-02-12T22:30:04Z",
  "username": "jeff",
  "id": 1
}

Create

Given a user.json file with the contents of a username and password {"username":"jeff","password":"password"}, you can create a new user via

$ curl -v -X POST -H "Content-Type: application/json" --data @user.json "http://$BALAAM_URL/users"
201

Patch

Because sometimes you need to change your password. Given a user.json file with the field password {"password":"new_password"}

$ curl -v -X PATCH -u "jeff:password" --data @user.json "http://$BALAAM_URL/users
204
Clone this wiki locally