Skip to content

Endpoints

This is documentation for the Endpoints admin page in RequestBite.

Prerequisites

To create an endpoint, you first need to:

Create a new endpoint

To add a new endpoint, do like this:

  1. Click the blue Add Endpoint in the upper right corner.
  2. In the form that appears, provide the following:
    1. Path
      This is a path that will be appended to the mock API hostname and your base URL. You can't leave this blank. See here for what types of paths you can create.
    2. Method
      Pick one of the supported HTTP methods.
    3. Model
      Pick one of your created models.

Types of paths

The following are examples of valid paths:

  • /users
    Will return an array of objects for e.g. GET requests.
  • /users/:id
    Is used to return (or e.g. update or delete) a specific object.
  • /users/contacts
    A nested path. Will return an array of objects for e.g. GET requests.
  • /users/contacts/:contactId
    A nested path. Used to return, update or delete a specific object.

Rules and limitations:

You cannot currently create nested paths like this:

/users/:id/delete

This is a limitation that we will eventually remove.

To have working resource endpoints, the name of a resource ID in your path needs to be the same as the resource ID in your corresponding model. I.e. if you have a path like this:

/users/:userId

Then the field in your model that represents your userId should have the same name, i.e.:

{
  "userId": "$uuid", // The field with value "$uuid" must be called "userId"
  "foo": "bar"
}