Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Suppose I am an a frontend engineer and I need a REST API which backend team is going to implement. I am waiting for that API to get implemented by backend team. Instead of waiting, one can just create the API Mock and use it in their workflow. Lets walk through step by step, how API Mock can be created.

Suppose I want to create the following API Mock:

API Endpoint/contact/{{contactId}} 
Method

GET

Response HeadersContent-Type: application/json
Response Body
{
  "_id": "{{contactId}}",
  "name": "John Doe",
  "email": "john.doe@example.com",
  "designation": "Chief Technical Officer",
  "organization": "Example.com",
  "country": "India",
  "aboutMe": "My name can be used as a placeholder name and I don't have any issue with that.",
  "twitterId": "fake.john.doe",
  "facebookId": "fake.john.doe",
  "githubId": "fake.john.doe",
  "createdOn": "2014-05-03T06:28:45.479Z"
}

...