In this article we will look at all the tools that are present in the endpoint functionality.
Path input
Each project has a unique domain, format <ID>-mock.migratech.cloud. When creating an endpoint, you only need to specify a route that starts with /.
For example /users, /auth/register. Maximum length - 128.
Search engine
To work with the search engine, you need to use URI segments of the format {id} or {id?} for optional parameters. We reviewed this functionality in detail on the page below:
The platform supports all the basic methods such as - GET, POST, PUT, DELETE and many response codes.
Body
You can use any text response. For JSON there is an object generator using loops. We'll look at this below. Maximum length - 5000 symbols.
Variables
The platform supports dynamic responses based on variables.
Variable format {$<variableName>}
Some variables support passing arguments. Let's look at some examples.
{$randomNumber} - simple variable with no arguments
{$randomNumberBetween:12,36} - where : indicates that the arguments will be listed next and , is the separator for each argument.
The full list of variables can be found on the page below:
You can create up to 10 headers, in key-value format.
For example: key content-type and value application/json
Cookies
You can create up to 10 cookies, in key-value-ttl format.
For example: key my_session and value somevalue and TTL 60
Embedded Blocks
You can create your own variables with code blocks that can be embedded in the main body of the response. You can also generate arrays of data using loops. Below you can familiarize yourself with this functionality in more detail.