-
Notifications
You must be signed in to change notification settings - Fork 1
Users
Jeffrey N. Davis edited this page Feb 13, 2017
·
2 revisions
The Users resource is like virtually any other Users resource.
$ 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
}
]
$ 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
}
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
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