DNY Node API (6 – Users)

dnyNodeAPI-Users source

First we sign in. Make sure you select post.
Use signin as url. Make sure you have the Body tab selected.
Then select radio button raw, and JSON application/json at the pull down.

Put the body below, where you specify the email and password using json:

Then press send. If the user exists, you’ll get a result back with a token property. Copy the value of the token.

Select Headers tab. Make sure there is a key Authorization. For the value type in “Bearer “, with a space behind it, then paste the token. Then change the url to /users so that we can get a list of all users.

You’ll see a lot of find the user that matches the user you’ve just authenticated and copy the id. Paste the id behind localhost:8080/user/{id}, then change the http verb to PUT. In the Body, make sure you specify the JSON key/value of whatever you want to change. So if you want to change the name property to something just go:

Let’s double check to make sure your update took place. Make sure you select ‘Get’, use the ID of the user that you’ve authenticated, and run it. You’ll see that the authenticated user’s name have been updated.