Posts

Get a post

get/posts/{id}

Request

  • Base URL
    https://gorest.co.in/public/v3
  • URL
    https://gorest.co.in/public/v3/posts/{id}
  • Auth
    • none
    • or HTTP bearer

Query parameters

postsstring

fields[posts]=id,title returns only those fields; included items are added whole.

includestring

Adds related items to each item, one level deep: user, comments. Comma separated.

Headers

If-None-Matchstring

An ETag from an earlier answer; an unchanged item answers 304 with no body.

Response

The post. With include the ETag is weak, as it covers the included items too.

bodystring
created_atstring date-time
idstring uuid required
published_atstring date-time nullable

Set by the server when the post is first published; null for a draft.

read_onlyboolean

True for sample data (the seed); it cannot be changed.

status'draft' | 'published'
titlestring
updated_atstring date-time
user_idstring uuid

The author; a user you can see.

Example response

{
  "comments": [
    {
      "post": {
        "title": "Cursor paging in five minutes",
        "user": {
          "email": "aarav.sharma@example.com",
          "name": "Aarav Sharma"
        }
      },
      "user": {
        "email": "aarav.sharma@example.com",
        "name": "Aarav Sharma"
      }
    }
  ],
  "title": "Cursor paging in five minutes",
  "user": {
    "email": "aarav.sharma@example.com",
    "name": "Aarav Sharma"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.