Using Simulated API Responses
All Cerebrum APIs can be queried using our API Response Simulation feature, which allows our integration partners to simulate API responses for testing purposes. This simulation feature returns data created by faker.js, a library that generates realistic mock data for testing purposes.
We created the API Response Simulation feature to simplify the process of building an integration with our APIs. When using the simulation feature you do not have to wait on orders or invites to be run through a live system. This allows you to instantly test your incoming webhook infrastructure and your logic to retrieve data and parse responses.
To use the API Response Simulation, simply add an HTTP query-string of ?simulate=true
to each request you make. This will trigger the API to generate a simulated response instead of executing the actual request. The simulated response will include the request parameters that were passed, but it will generate mock data for all other fields.
To test incoming webhooks, use the /simulate-webhook
route. This will trigger a sample webhook for the order or invite ID you pass.
A Postman configuration file is available on request to help users configure their requests to use the API Response Simulation feature. This file includes pre-configured requests with the ?simulate=true
query-string set.
Note that the data returned when using the API Response Simulation feature is not static, and therefore the generated mock data will not be consistent across models or requests, even for the same input. For example, performing a GET request for a simulated order with a UUID of ORD_9021963f-671f-4087-971c-01751b05ee9f
will return different fields (including name, date of birth, score, status, etc.) for each new request, even if the UUID is the same.
Also, please understand that the API Response Simulation feature is intended for testing purposes only and should not be used in production environments. While the simulated response data accurately represents the data structure that would be returned by the live API, it is not real data and should not be used for anything besides testing and generating mock responses for development purposes.
Updated over 1 year ago