DocsUsers
Users API
The users endpoint provides a versatile dataset of sample user information and related data like carts, posts, and todos, making it ideal for testing and prototyping user management functionalities in web applications.
GET
/usersReturns a paginated list of users.
Code Examples
fetch
fetch('https://api.dhanyalvian.my.id/dummy/v1/users', {
headers: { 'Content-Type': 'application/json' }
})
.then(res => res.json())
.then(data => console.log(data))
.catch(err => console.error(err));URL
https://api.dhanyalvian.my.id/dummy/v1/usersQuery Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| page | number | 1 | Page number for pagination. |
| limit | number | 20 | Number of items per page. |
| search | string | — | Search by firstname, lastname, or email. |
Response (200 OK)
{
"meta": {
"reqId": "e57b72ae-fa98-4afa-ad9c-0b8eebe97cbc",
"code": "200"
},
"message": "",
"pagination": {
"page": 1,
"next": 2,
"record": 2,
"totalPage": 125,
"totalRecord": 250
},
"records": [
{
"id": "250",
"firstname": "Adalberto",
"lastname": "Zieme",
"email": "adalberto.zieme@dummyapi.my.id",
"phone": "706-8508-7519",
"avatar": "https://api.dicebear.com/9.x/initials/svg?seed=Adalberto%20Zieme",
"gender": "F"
},
{
"id": "249",
"firstname": "Moses",
"lastname": "Conn",
"email": "moses.conn@dummyapi.my.id",
"phone": "783-7859-9381",
"avatar": "https://api.dicebear.com/9.x/initials/svg?seed=Moses%20Conn",
"gender": "M"
}
]
}Try it Yourself
GET
Query Params
page:
limit:
search:
GET
/users/:idReturns a single user by ID.
Code Examples
fetch
fetch('https://api.dhanyalvian.my.id/dummy/v1/users/1', {
headers: { 'Content-Type': 'application/json' }
})
.then(res => res.json())
.then(data => console.log(data))
.catch(err => console.error(err));URL
https://api.dhanyalvian.my.id/dummy/v1/users/:idPath Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| id | string | Required | The unique identifier of the user. |
Response (200 OK)
{
"meta": {
"reqId": "23f9fa10-e48c-4e8c-b2cd-9dbe859a3ad5",
"code": "200"
},
"message": "",
"record": {
"id": "1",
"firstname": "Malinda",
"lastname": "Renner",
"email": "malinda.renner@dummyapi.my.id",
"phone": "685-4782-5518",
"avatar": "https://api.dicebear.com/9.x/initials/svg?seed=Malinda%20Renner",
"gender": "M",
"password": "mCGEwY2V2JQloLASiiA11",
"passwordHash": "$2b$10$BxzTN9LXyb.acIGqdOZVnuJ222ycsVGgzP4GX9jUOEig9Rp/AZvf6"
}
}Error Response
{
"meta": {
"reqId": "4a16367e-66bc-4d5c-8ac1-c7e2eb294724",
"code": "400"
},
"message": "Data not found"
}Try it Yourself
GET