Defining a mock API
Last updated
Last updated
For a database, you define the mock API on the database API tab.
By default, the API tab contains a commented-out example mock API definition.
One option is to enter the mock API definition directly in the definition field.
For information on the API syntax, go to Mock API reference.
After you populate the definition, to save it, click Save.
To use the Fabricate AI to generate the mock API definition:
Click Compose with AI.
On the Compose with API panel, provide a description of the calls to include in the mock API, then click Generate.
To add the generated results to the mock API, click Add to API.
On the API tab, to save the new definition content, click Save.
Every time to save the mock API definition, Fabricate adds an entry to the definition history.
You can view the changes for each saved version, and revert to a previous version.
On the API tab, to display the change history, click History.
The History panel lists the versions in reverse chronological order, with the current version at the top.
When you click a version, Fabricate shows the differences from the previous version, including new and removed content.
To revert the mock API definition to a previous version:
In the version list, click the version to revert to.
Click Revert to This Version.