Documentation

You can copy paste the code in your browser console to quickly test Store API.

User

Get all users

fetch('STORE_CLIENT_API_BASE_URL/users')
  .then(response => response.json())
  .then(json => console.log(json))

Get single user

fetch('STORE_CLIENT_API_BASE_URL/users/612e4851345dcc333ac6cb24')
  .then(response => response.json())
  .then(json => console.log(json))

Add new user

fetch('STORE_CLIENT_API_BASE_URL/users',
  {
    method: 'POST',
    body: JSON.stringify({
        name: 'Ron Bin Nawaz',
        email: '[email protected]',
        number: 72342341,
        password: 'pass12345',
        password_repeat: 'pass12345'
    }),
    headers: {
        'Content-type': 'application/json; charset=UTF-8',
    },
  })
  .then(response => response.json())
  .then(json => console.log(json))

Update user

fetch('STORE_CLIENT_API_BASE_URL/users/612e4851345dcc333ac6cb24',
  {
    method: 'PUT',
    body: JSON.stringify({
        name: 'Alex Pi',
        number: 12025550108,
        password: 'Simple12345'
        password_repeat: 'Simple12345'
    }),
    headers: {
        'Content-type': 'application/json; charset=UTF-8',
    },
  })
  .then(response => response.json())
  .then(json => console.log(json))

Delete user

fetch('STORE_CLIENT_API_BASE_URL/users/612e4851345dcc333ac6cb24',
  {
    method: 'DELETE',
  })
  .then(response => response.json())
  .then(json => console.log(json))