« Mock Data

Posts & Comments API

30 posts, each owned by a user (userId), with 90 comments in total spread across them. Comments reference their post via postId, independent of the Users resource (like real blog comments, not necessarily from a registered user).

Endpoints

MethodPathDescription
GET/mock-data/postsList posts. Supports ?userId=, ?page=, ?limit= (max 50).
GET/mock-data/posts/:idFetch a single post.
GET/mock-data/posts/:id/commentsAll comments on that post.
POST/mock-data/postsFake create. Not persisted.
PUT / PATCH/mock-data/posts/:idFake update. Not persisted.
DELETE/mock-data/posts/:idFake delete. Not persisted.
GET/mock-data/commentsList comments. Supports ?postId=, ?page=, ?limit=.
GET/mock-data/comments/:idFetch a single comment.
POST / PUT / PATCH / DELETE/mock-data/comments / /mock-data/comments/:idSame fake-CRUD pattern as posts.

Example

{
  "id": 1,
  "userId": 8,
  "title": "A guide to caching strategies",
  "body": "A simpler approach turned out to work just as well."
}

List posts » · Comments on post 1 »