Getting Started

Setup and make a request to a Mock in 5 minutes or less.

Video

Steps

  1. Click the "Log In" menu item in the upper right

  2. Click "Create Account" button, fill out the form, and submit if you haven't created an account yet.

  3. Enter your email and password and submit if you already have an account.

  4. Service mocks will automatically create a "hello-world" service for you when you create an account.

  5. Click on "hello-world" in the left nav.

  6. Click on the "Mock" tab

  7. Expand the "default" environment

  8. Service Mocks will automatically add "GET /hello-world" resource for you when you create a new service.

  9. Expand the resource labeled "GET /hello-world"

  10. Click the "Add Response" button, enter a "Name" of "Success"

  11. Click on the "Return" tab, then the "Status/Headers" menu item and select "200".

  12. Click on the "Body" menu item, and fill set it to {"hello": "world"}and click the "Add" button.

  13. Add another response using steps 11-14 again, but name it "Bad Request", select "400" for the "Status" and set the "Body" to {"bad": "request"}

  14. Scroll to the top of your open "default" environment pane and copy the mock URL which should look like: https://servicemocks.com/m/<account-name>/hello-world/1.0.0/default where the <account-name> is matches what you used in your account creation step.

  15. Open Postman or cURL, paste this URL, concatenate "/hello-world" to it.

  16. Send a request. You should see a "Status" of "200" and a body of{"hello": "world"}

  17. Open the console again and toggle "Bad Request" as the active response.

  18. Repeat step 17 but this time you should see a "Status" of "400" a body of {"bad": "request"}

Last updated

Was this helpful?