The MockX User API is designed to offer developers comprehensive control over user profile management within their applications. It provides the functionality to manage user data effectively, including personal and authentication details, as well as access to user-associated resources such as carts, posts, and todos.
Endpoints Overview
This API includes a variety of endpoints tailored for extensive user management:
GET / : Retrieves all users.
GET /me : Fetches the profile of the authenticated user.
GET /search : Searches for users based on query ### parameters.
GET /filter : Filters users based on specific criteria.
GET /:id : Retrieves a specific user by their unique ID.
GET /:userId/carts : Fetches carts associated with a specific user.
GET /:userId/posts : Retrieves posts created by a specific user.
GET /:userId/todos : Fetches todos assigned to a specific user.
POST /add : Adds a new user.
PUT /:id : Updates an entire user profile by ID.
PATCH /:id : Partially updates a user profile by ID.
DELETE /:id : Deletes a user profile by ID.
Get All Users
Fetch a comprehensive list of users.
GET https://api.mockx.net/users
Parameters:
limit: Limits the number of users returned.
skip: Skips a specified number of users.
Example Response:
{
"users" : [
{
"id" : 1 ,
"firstName" : "Jessica" ,
"lastName" : "Gonzalez" ,
"maidenName" : "Smitham" ,
"age" : 50 ,
"gender" : "female" ,
"email" : "user0@example.com" ,
"phone" : "+1 237 682 7883" ,
"username" : "user0" ,
"password" : "se5lbzdl" ,
"birthDate" : "1989-09-10" ,
"image" : "https://api.multiavatar.com/avatar20.svg" ,
"bloodGroup" : "A-" ,
"height" : 189 ,
"weight" : 75.4 ,
"eyeColor" : "Green" ,
"hair" : {
"color" : "Black" ,
"type" : "Strands"
},
"domain" : "user0domain.com" ,
"ip" : "131.133.30.249" ,
"address" : {
"address" : "3505 Street" ,
"city" : "Dallas" ,
"coordinates" : {
"lat" : -83 ,
"lng" : 49
},
"postalCode" : "53190" ,
"state" : "SomeState"
},
"macAddress" : "85:5d:f3:e4:0c:9d" ,
"university" : "University of Example" ,
"bank" : {
"cardExpire" : "06/22" ,
"cardNumber" : "50380955204220685" ,
"cardType" : "maestro" ,
"currency" : "Peso" ,
"iban" : "NO17 0695 2754 967"
},
"company" : {
"name" : "ExampleCorp" ,
"department" : "Information Security" ,
"title" : "Designer"
},
"ein" : "20-9487066" ,
"ssn" : "661-64-2976" ,
"userAgent" : "Mozilla/5.0 (Windows NT 10.0; Win64; x64)" ,
"crypto" : {
"coin" : "Bitcoin" ,
"wallet" : "0xb9fc2fe63b2a6c003f1c324c3bfa53259162181a" ,
"network" : "Ethereum (ERC20)"
}
},
...
],
"total" : 500 ,
"skip" : 0 ,
"limit" : 20
}
Get Current User Profile
Retrieve the profile of the currently authenticated user.
GET https://api.mockx.net/users/me
Authentication:
Required: Bearer token.
Example Response:
{
"user" : { ... }
}
Search Users
Search for users based on specific query ### parameters.
GET https://api.mockx.net/users/search?q=Jennifer
Parameters:
q: The search query.
Example Response:
{
"users" : [
{
"id" : 26 ,
"firstName" : "Jennifer" ,
"lastName" : "Baker" ,
"maidenName" : "Deckow" ,
"age" : 35 ,
"gender" : "female" ,
"email" : "user25@example.com" ,
"phone" : "+1 281 235 8031" ,
"username" : "user25" ,
"password" : "7xq7suwf" ,
"birthDate" : "1983-09-03" ,
"image" : "https://api.multiavatar.com/avatar21.svg" ,
"bloodGroup" : "O-" ,
"height" : 146 ,
"weight" : 65.5 ,
"eyeColor" : "Blue" ,
"hair" : {
"color" : "Blond" ,
"type" : "Wavy"
},
"domain" : "user25domain.com" ,
"ip" : "168.151.19.44" ,
"address" : {
"address" : "6685 Street" ,
"city" : "Houston" ,
"coordinates" : {
"lat" : 8 ,
"lng" : -153
},
"postalCode" : "92366" ,
"state" : "SomeState"
},
"macAddress" : "c8:a0:27:48:e5:72" ,
"university" : "University of Example" ,
"bank" : {
"cardExpire" : "07/24" ,
"cardNumber" : "3587188969123346" ,
"cardType" : "jcb" ,
"currency" : "Rupiah" ,
"iban" : "AD24 9240 6903 OD2X OW1Y WD1K"
},
"company" : {
"name" : "ExampleCorp" ,
"department" : "Human Resources" ,
"title" : "Customer Service Manager"
},
"ein" : "38-0997138" ,
"ssn" : "407-02-8915" ,
"userAgent" : "Mozilla/5.0 (Windows NT 10.0; Win64; x64)" ,
"crypto" : {
"coin" : "Bitcoin" ,
"wallet" : "0xb9fc2fe63b2a6c003f1c324c3bfa53259162181a" ,
"network" : "Ethereum (ERC20)"
}
},
...
],
"total" : 10 ,
"skip" : 0 ,
"limit" : 10
}
Filter Users
Filter users based on specified criteria.
GET https://api.mockx.net/users/filter?key=gender&value=female
Parameters:
key: The field to filter by.
value: The value to match for the specified field.
Example Response:
{
"users" : [
{
"id" : 1 ,
"firstName" : "Jessica" ,
"lastName" : "Gonzalez" ,
"maidenName" : "Smitham" ,
"age" : 50 ,
"gender" : "female" ,
"email" : "user0@example.com" ,
"phone" : "+1 237 682 7883" ,
"username" : "user0" ,
"password" : "se5lbzdl" ,
"birthDate" : "1989-09-10" ,
"image" : "https://api.multiavatar.com/avatar20.svg" ,
"bloodGroup" : "A-" ,
"height" : 189 ,
"weight" : 75.4 ,
"eyeColor" : "Green" ,
"hair" : {
"color" : "Black" ,
"type" : "Strands"
},
"domain" : "user0domain.com" ,
"ip" : "131.133.30.249" ,
"address" : {
"address" : "3505 Street" ,
"city" : "Dallas" ,
"coordinates" : {
"lat" : -83 ,
"lng" : 49
},
"postalCode" : "53190" ,
"state" : "SomeState"
},
"macAddress" : "85:5d:f3:e4:0c:9d" ,
"university" : "University of Example" ,
"bank" : {
"cardExpire" : "06/22" ,
"cardNumber" : "50380955204220685" ,
"cardType" : "maestro" ,
"currency" : "Peso" ,
"iban" : "NO17 0695 2754 967"
},
"company" : {
"name" : "ExampleCorp" ,
"department" : "Information Security" ,
"title" : "Designer"
},
"ein" : "20-9487066" ,
"ssn" : "661-64-2976" ,
"userAgent" : "Mozilla/5.0 (Windows NT 10.0; Win64; x64)" ,
"crypto" : {
"coin" : "Bitcoin" ,
"wallet" : "0xb9fc2fe63b2a6c003f1c324c3bfa53259162181a" ,
"network" : "Ethereum (ERC20)"
}
},
...
]
}
Add New User
Create a new user profile.
POST https://api.mockx.net/users/add
{
"firstName" : "Jessica" ,
"lastName" : "Gonzalez" ,
"maidenName" : "Smitham" ,
"age" : 50 ,
"gender" : "female" ,
"email" : "user0@example.com" ,
"phone" : "+1 237 682 7883" ,
"username" : "user0" ,
"password" : "se5lbzdl" ,
"birthDate" : "1989-09-10" ,
"image" : "https://api.multiavatar.com/avatar20.svg" ,
"bloodGroup" : "A-" ,
"height" : 189 ,
"weight" : 75.4 ,
"eyeColor" : "Green" ,
"hair" : {
"color" : "Black" ,
"type" : "Strands"
},
"domain" : "user0domain.com" ,
"ip" : "131.133.30.249" ,
"address" : {
"address" : "3505 Street" ,
"city" : "Dallas" ,
"coordinates" : {
"lat" : -83 ,
"lng" : 49
},
"postalCode" : "53190" ,
"state" : "SomeState"
},
"macAddress" : "85:5d:f3:e4:0c:9d" ,
"university" : "University of Example" ,
"bank" : {
"cardExpire" : "06/22" ,
"cardNumber" : "50380955204220685" ,
"cardType" : "maestro" ,
"currency" : "Peso" ,
"iban" : "NO17 0695 2754 967"
},
"company" : {
"name" : "ExampleCorp" ,
"department" : "Information Security" ,
"title" : "Designer"
},
"ein" : "20-9487066" ,
"ssn" : "661-64-2976" ,
"userAgent" : "Mozilla/5.0 (Windows NT 10.0; Win64; x64)" ,
"crypto" : {
"coin" : "Bitcoin" ,
"wallet" : "0xb9fc2fe63b2a6c003f1c324c3bfa53259162181a" ,
"network" : "Ethereum (ERC20)"
}
}
Body:
Include all necessary user details in the request body.
Example Response:
{
"id" : 101 ,
"firstName" : "Jessica" ,
"lastName" : "Gonzalez" ,
"maidenName" : "Smitham" ,
"age" : 50 ,
"gender" : "female" ,
"email" : "user0@example.com" ,
"phone" : "+1 237 682 7883" ,
"username" : "user0" ,
"password" : "se5lbzdl" ,
"birthDate" : "1989-09-10" ,
"image" : "https://api.multiavatar.com/avatar20.svg" ,
"bloodGroup" : "A-" ,
"height" : 189 ,
"weight" : 75.4 ,
"eyeColor" : "Green" ,
"hair" : {
"color" : "Black" ,
"type" : "Strands"
},
"domain" : "user0domain.com" ,
"ip" : "131.133.30.249" ,
"address" : {
"address" : "3505 Street" ,
"city" : "Dallas" ,
"coordinates" : {
"lat" : -83 ,
"lng" : 49
},
"postalCode" : "53190" ,
"state" : "SomeState"
},
"macAddress" : "85:5d:f3:e4:0c:9d" ,
"university" : "University of Example" ,
"bank" : {
"cardExpire" : "06/22" ,
"cardNumber" : "50380955204220685" ,
"cardType" : "maestro" ,
"currency" : "Peso" ,
"iban" : "NO17 0695 2754 967"
},
"company" : {
"name" : "ExampleCorp" ,
"department" : "Information Security" ,
"title" : "Designer"
},
"ein" : "20-9487066" ,
"ssn" : "661-64-2976" ,
"userAgent" : "Mozilla/5.0 (Windows NT 10.0; Win64; x64)"
}
Update User by ID
Modify the details of an existing user.
PUT https://api.mockx.net/users/{id}
{
"firstName" : "Jessica" ,
"lastName" : "Gonzalez" ,
"maidenName" : "Smitham" ,
"age" : 50 ,
"gender" : "female" ,
"email" : "user0@example.com" ,
"phone" : "+1 237 682 7883" ,
"username" : "user0" ,
"password" : "se5lbzdl" ,
"birthDate" : "1989-09-10" ,
"image" : "https://api.multiavatar.com/avatar20.svg" ,
"bloodGroup" : "A-" ,
"height" : 189 ,
"weight" : 75.4 ,
"eyeColor" : "Green" ,
"hair" : {
"color" : "Black" ,
"type" : "Strands"
},
"domain" : "user0domain.com" ,
"ip" : "131.133.30.249" ,
"address" : {
"address" : "3505 Street" ,
"city" : "Dallas" ,
"coordinates" : {
"lat" : -83 ,
"lng" : 49
},
"postalCode" : "53190" ,
"state" : "SomeState"
},
"macAddress" : "85:5d:f3:e4:0c:9d" ,
"university" : "University of Example" ,
"bank" : {
"cardExpire" : "06/22" ,
"cardNumber" : "50380955204220685" ,
"cardType" : "maestro" ,
"currency" : "Peso" ,
"iban" : "NO17 0695 2754 967"
},
"company" : {
"name" : "ExampleCorp" ,
"department" : "Information Security" ,
"title" : "Designer"
},
"ein" : "20-9487066" ,
"ssn" : "661-64-2976" ,
"userAgent" : "Mozilla/5.0 (Windows NT 10.0; Win64; x64)" ,
"crypto" : {
"coin" : "Bitcoin" ,
"wallet" : "0xb9fc2fe63b2a6c003f1c324c3bfa53259162181a" ,
"network" : "Ethereum (ERC20)"
}
}
Parameters:
id: The unique identifier of the user to be updated.
Body:
Include the user details to be updated in the request body.
Example Response:
{
"id" : 1 ,
"firstName" : "Jessica" ,
"lastName" : "Gonzalez" ,
"maidenName" : "Smitham" ,
"age" : 50 ,
"gender" : "female" ,
"email" : "user0@example.com" ,
"phone" : "+1 237 682 7883" ,
"username" : "user0" ,
"password" : "se5lbzdl" ,
"birthDate" : "1989-09-10" ,
"image" : "https://api.multiavatar.com/avatar20.svg" ,
"bloodGroup" : "A-" ,
"height" : 189 ,
"weight" : 75.4 ,
"eyeColor" : "Green" ,
"hair" : {
"color" : "Black" ,
"type" : "Strands"
},
"domain" : "user0domain.com" ,
"ip" : "131.133.30.249" ,
"address" : {
"address" : "3505 Street" ,
"city" : "Dallas" ,
"coordinates" : {
"lat" : -83 ,
"lng" : 49
},
"postalCode" : "53190" ,
"state" : "SomeState"
},
"macAddress" : "85:5d:f3:e4:0c:9d" ,
"university" : "University of Example" ,
"bank" : {
"cardExpire" : "06/22" ,
"cardNumber" : "50380955204220685" ,
"cardType" : "maestro" ,
"currency" : "Peso" ,
"iban" : "NO17 0695 2754 967"
},
"company" : {
"name" : "ExampleCorp" ,
"department" : "Information Security" ,
"title" : "Designer"
},
"ein" : "20-9487066" ,
"ssn" : "661-64-2976" ,
"userAgent" : "Mozilla/5.0 (Windows NT 10.0; Win64; x64)"
}
Delete User by ID
Remove a user profile from the system.
DELETE https://api.mockx.net/users/{id}
Parameters:
id: The unique identifier of the user to be deleted.
Example Response:
{
"message" : "User with id '{id}' successfully deleted."
}