DummyAPI
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/users

Returns 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/users
Query Parameters
NameTypeDefaultDescription
pagenumber1Page number for pagination.
limitnumber20Number of items per page.
searchstringSearch 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/:id

Returns 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/:id
Path Parameters
NameTypeRequiredDescription
idstringRequiredThe 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