API Test server for Developers

How it works

This site give you a possibility to use the Mock API server for a testing of your web applications.

It is free and a CORS policy setted to "all" request so, you can use the fetch() command as you wish.

Our service has a set of the most popular cases for API like users, addresses, payments etc. The part of routes has a logic relations to next API routes an could be used for a checking of an API calls chaining.

A list of API routes

Get a list of the all available users in service (up to 10) without a detailed information.

{
  id: 10001,
  username: "jonnyd",
  role: "admin",
  avatar: '/images/avatars/10001.png'
}

Get a detailed information about the current user by ID.

{
  id: 10001,
  username: "jonnyd",
  role: "admin",
  first_name: "Jonny",
  last_name: "Datagramma",
  creation_date: 1606900200000,
  last_visit_date: 1668199597829
}

Emulates a making a new user in system. Request should be have the filled mandatory fields. This new user will not added to our service, just returns back a 201 status code and an User Details object for make a control from request side.

There are the mandatory fields (their length should be not more 50 characters):

{
  username: "jonnyd",
  first_name: "Jonny",
  last_name: "Datagramma",
}

An ID of the created user always will be a new after every POST request (it is a feature).

Emulates an updating the User in database. Request should be have the filled mandatory fields.

Returns back an object with requested fields which sends back for make a control from request side.

Delete the User by ID. In real the Users stays in our service, just returns a response about this event for control from client side.

Sometimes a Developer needs to check how the error catching flow works. No problem! Below you can see the routes which provide the error answers to check how works the errors from request.

That route returns back an error 408 during 5-10 seconds.

That route returns back an error 404.

That route returns back a server fault with status 500.

Every User can have the addresses wich marked as shipping or billing. So there presents a functionality which returns an Addresses list for some user by their ID.

Also we can add a new address or delete the one.

Get a list of the addresses for some User, could be empty. The User ID is mandatory for this request.

[
  {
    id: 20001,
    userId: 10001,
    type: "shipping",
    country: "Neverland",
    city: "Bigrouter",
    address: "255 Dev Null st.",
    phone: "+127001",
  },
  ...
]

Make a new address for some User. The User Id is mandatory. Returns back an Address object associated with the User. That object will not be added to our server.

{
  id: 20001,
  userId: 10001,
  type: "shipping",
  country: "Neverland",
  city: "Bigrouter",
  address: "255 Dev Null st.",
  phone: "+127001",
}

An ID of the created address always will be a new after every POST request (it is a feature).

Emulates a deleting the address from server by address ID (ID is mandatory). Returns back an object with no error status.

{
  error: false,
  msg: "Address <ID> was deleted successfully",
}

Every User can have some payments methods. Usually it is an object wich has a token from paiment system, type of that system and credit card number mask.

Also there can add a new payment method or delete the one.

Get a list of the payment methods for some User, could be empty. The User ID is mandatory for this request.

[
  {
    id: 30001,
    userId: 10001,
    type: "visa",
    card: "47****3385",
    paymentId: "48f71d5efade496978eef5e6e7c30934e8ae6b05259dbe0effcc23e288375aef",
    expires: "01/24",
  },
  ...
]

Make a new payment method for some User. The User Id is mandatory. Returns back an Address object associated with the User. That object will not be added to our server.

{
  id: 30001,
  userId: 10001,
  type: "visa",
  card: "47****3385",
  paymentId: "48f71d5efade496978eef5e6e7c30934e8ae6b05259dbe0effcc23e288375aef",
  expires: "01/24",
}

An ID of the created payment method always will be a new after every POST request (it is a feature).

Emulates a deleting the payment method from server by payment method ID (ID is mandatory). Returns back an object with no error status.

{
  error: false,
  msg: "The Payment Method <ID> was deleted successfully",
}