Skip to content

get users id

Harmun edited this page May 14, 2019 · 1 revision

get /users/:id User Return a user specified by id None { id, userName, dateCreated }

GET users/:id

Returns a single user specified by the id parameter.
See GET users for getting users in bulk.

Restrictions

  • Users can only access data for their own ID, unless they have the admin user role.
  • The id parameter must be numeric.

Resource Information

Response formats JSON
Requires authentication? Yes

Example Request

curl -X GET \
  http://localhost:3000/users/2 \
  -H 'Authorization: Bearer 123testtoken123' \
  -H 'Host: localhost:3000'

Example Response

A single user is returned as an object like this:

{
    "id": 2,
    "userName": "SteveRogers1918",
    "dateCreated": "2019-05-14T10:01:56.000Z"
}
Clone this wiki locally