Currently, all user endpoints are only available as GET requests
All user objects returned will be formated as demonstrated in the Getting Started section.
Returns a single user.
GET
/users/getOneUser
This endpoint accepts no parameters and returns one JSON user object.
The user object is selected randomly from the database.
example usage: /users/getOneUser
Returns one or more users with matching parameters.
GET
/users/getUser/key&value
This endpoint requires two parameters, and allows two additional query terms.
required:
key
- The key to search forvalue
- The value desired to matchoptional:
all
- Returns all matching userscount
- Returns all users up to the count specifiedThe key
matches parameters within the "records" object.
The full list of searchable keys are as follows:
firstName
lastName
age
email
dob
This endpoint returns a JSON array of user objects.
example usage:
/users/getUser/firstName&John?all=true
Return all users with the first name "John"
/users/getUser/age&35?count=5
Return the first 5 users aged 35
/users/getUser/lastName&Smith
Return the first matching user with the last name "Smith"
Considerations for using this endpoint:
key
and value
are required and must be seperated by the &
character.
If search terms are used, they must be seperated from key&value
using the ?
character.
If both search terms are used, they must be seperated from each other by the &
character.
note: This is not recommended as count
will be ignored.
If no query terms (count
or all
) are defined, the default response will be the first record matching the parameter criteria.
If both query terms are provided the all
term will take precedence and default to true.
If count
is defined, the endpoint will return the first count
records matching the parameter criteria.
If count
is larger than the amount of available user records, all records will be returned. This ensures no null records are returned.
Returns all users in the database.
GET
/users/getAll
This endpoint accepts no parameters and returns a JSON array of user objects.
example usage: /users/getAll
Returns 100 randomly selected users.
GET
/users/random
This endpoint accepts no parameters and returns a JSON array of 100 random user objects.
example usage: /users/random