Skip to content

Workspaces

The top-level concept of SmartMock.io is a workspace. Every workspace is identified by a unique URL you'll use to send requests to your mocks. We encourage you to treat a workspace as a contained environment for a single service/API/application you'd like to simulate. This approach simplifies the management of workspaces and mocks. You may, however, merge many services/APIs into individual Workspace if r required.

Create New Blank Workspace

To create a blank workspace, navigate to the Dashboard and click Create/Import -> New Blank Workspace.

  • In the Name field, enter the descriptive name of a workspace, for instance, CRM Mock.
  • In the Domain field, enter the name of the subdomain you'll use to access your workspace. Please note that the subdomain may contain letters, digits, and hyphens and is case insensitive. You may also generate a new random name. Your workspace's subdomain must be globally unique.
  • In the Team field, select a team. Every workspace created can belong to only one team.
  • In the Template Mocks Runtime Version and Dynamic Mocks Runtime Version fields, select the values marked as current.
  • Click Create.
  • You will see the newly created workspace in the list of workspaces.

Please note that the number of workspaces you may create depends on the plan you are subscribed to.

Workspace Form

Access Workspace

A unique URL identifies every workspace. Use that URL to access mocks within the workspace. You may use either HTTP or HTTPS protocol depending on your needs.

Import Workspace

You may import Swagger 2.0 or OpenAPI 3.0 documents as a new workspace. To do this, navigate to the Dashboard and click Create/Import -> Import from Swagger/OpenAPI.

  • In the Name field, enter a descriptive name of a workspace, for instance, Order Management.
  • In the Domain field, enter the name of the subdomain you'll use to access your workspace. Please note that the subdomain may contain letters, digits, hyphens and is case insensitive. You may also generate a new random name. Your workspace's subdomain must be globally unique.
  • In the Team field, select a team. Every workspace created can belong to only one team.
  • In the Template Mocks Runtime Version and Dynamic Mocks Runtime Version fields, select the values marked as current.
  • Choose how you would like to import the workspace -- Select From Text if you want to paste the document content. The maximum document size is 200KB. -- Select From URL if you'd like to point to a URL that contains the document. -- Select From File if you'd like to upload a document. The maximum document size is 5MB.
  • Click Import.
  • You will see the imported workspace on the list of workspaces.

Import Workspace Form

Delete Workspace

To delete a workspace, click the Delete Workspace button for the workspace you would like to delete. In the dialog, type “delete” to confirm deletion and click Delete.

Deleting workspace also deletes all mocks within that workspace. This action cannot be undone.

Testing

SmartMock.io provides an in-app feature for testing the workspace. In the Workspace Details or New/Edit Mock view, click the Test request button. Select the HTTP method, path, content type, headers (Optional), and body, and click Send. The result of the test is displayed below the test form.

You may get one of the following test statuses:

  • matched - One mock was matched to the request. Go to the Matching details section to check detailed information about which mock was matched and why.
  • no match - No mocks matched the request. Go to the Matching details section to check detailed information on why there was no match.
  • execution timeout - Code or template execution exceeded maximum invocation time. See Limits for more details.
  • code error - There was an error during the execution of the mock code. See Mock execution logs for more details.
  • template error - There was an error during the execution of the mock template. See Mock execution logs for more details.
  • dynamic mocks disabled - Dynamic mocks are disabled. Please enable them or contact our support.
  • simulated fault - There was an HTTP/network fault simulation performed for this request.
  • quota exceeded - Monthly request quota exceeded. Please upgrade your plan or wait for the next billing period for the quota to replenish.
  • too many concurrent - Too many concurrent requests. See Limits for more details.
  • request too large - Request body too large. See Limits for more details.
  • state too large - State too large. See Limits for more details.
  • response too large - Response generated by template or code was too large. See Limits for more details.
  • unknown error - Unknown error has occurred. Please try again later or contact our support.

Beside a test status, the following information is returned:

  • Request details - Contains request ID, method, URL, headers, and body (some diagnostic headers are excluded).
  • Mocking details - Contains a link to the matched mock, mock execution logs, and matching details. Mock execution logs are produced by template or dynamic mock types. These logs may be used to troubleshoot errors in templates (especially helper usage) and dynamic mock code. Matching details present a list of mocks for which request matching was performed, and the first non-matched field. This information may be helpful while diagnosing matching problems.
  • Response details - Contains returned HTTP status code, headers, and body.

Workspace Test

Request Log

SmartMock.io also keeps logs of the 100 most recent calls to the workspace. This information may be used for troubleshooting purposes. To view workspace logs, navigate to the Workspace Details view and click Logs. To display all logged requests, click the Search button. It's also possible to filter requests by matched mocks, unmatched mocks, or errors.

Workspace Logs


Last update: December 9, 2020