Slackbot
03/14/2023, 2:52 PMAaron
03/14/2023, 3:33 PMJoana Baptista
03/14/2023, 4:10 PMRob Elliot
03/15/2023, 9:34 AM/contacts/[0-9]+
(see "Regex matching on the path only").
Enable response templating.
Set the response body to be something like:
{
"id": "{{request.path.[1]}}",
"firstName": "Suki",
"lastName": "Patel",
"email": "<mailto:spatel@example.com|spatel@example.com>",
"dateAdded": "2020-11-12",
"companyId": "123"
}
Joana Baptista
03/15/2023, 7:20 PMRob Elliot
03/15/2023, 7:27 PMGET /contacts/1
to return the first element in the GET /contacts
response, and so on, you will need to add a specific stub for each contact with the appropriate path and body.
Generally it's a better idea not to, and to use random data or data from the request, but it will depend on your usecase.Joana Baptista
03/19/2023, 5:46 PM