Skip to content

Latest commit

 

History

History
60 lines (40 loc) · 1.08 KB

File metadata and controls

60 lines (40 loc) · 1.08 KB

List Users


  • URL

    /users

  • Method:

    GET

  • URL Params

    Optional:

    fields=[username, email, name]

    limit=[integer]

    sort=[asc|desc]

    sort_by=[id|name|birthdate|username|email]

    group_by=[name|username]

  • Success Response:

    • Code: 200
  • Error Response:

    • Code: 401 UNAUTHORIZED

    • Code: 503 SERVICE UNAVAILABLE

      • Content: { "error": "Unavailable storage" }
  • Sample Call:

    curl -X "GET" "http://api.example.com/users" \
    	-H "Content-Type: application/json; charset=utf-8" \
    	-H "Cache-Control: no-cache" \
    	-H "Authorization: Basic YWRtaW46MHJ0cjBuMWNz" \
    	-H "Accept: application/json"
    
  • Notes:

    • The sort parameter defaults to name
    • The sort_by parameter defaults to asc
    • Response body:
      {
          "count": 2,
          "users": [
      	    {"username00", "[email protected]", "User Zero"},
      	    {"username01", "[email protected]", "User One"}
          ]
      }