API V1 is deprecated, Check out new API V2 here

Comments and Comment Threads

comments#create - Create a nested reply to a comment

Parameters

Name Description
body required The text of the comment you want to save. Allowed html tags are: `br strong b em i img a`
post_id The id the post the comment belongs to (passed via URL)
parent_comment_id The id of the parent comment if this is a nested reply

Request

Route

POST /v1/comments

Headers

Accept: application/json
Content-Type: application/json
Authorization: Bearer your_access_token
Host: api.producthunt.com

Body

{
  "comment": {
    "body": "This is a reply!",
    "post_id": 1543,
    "parent_comment_id": 699
  }
}

Response

Status

201 Created

Headers

X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
X-Rate-Limit-Limit: 900
X-Rate-Limit-Remaining: 900
X-Rate-Limit-Reset: 900
Content-Type: application/json; charset=utf-8
ETag: W/"d8701699d08df64412f48d6e1c36500d"
Cache-Control: max-age=0, private, must-revalidate
Content-Length: 7031

Body

{
  "comment": {
    "id": 700,
    "body": "This is a reply!",
    "created_at": "2021-05-05T04:39:20.565-07:00",
    "parent_comment_id": 699,
    "user_id": 10313,
    "subject_id": 1543,
    "child_comments_count": 0,
    "url": "http://www.producthunt.com/posts/awesome-idea-134#comment-700",
    "post_id": 1543,
    "subject_type": "Post",
    "sticky": false,
    "votes": 0,
    "post": {
      "comments_count": 1,
      "id": 1543,
      "name": "Awesome Idea #134",
      "product_state": "default",
      "tagline": "Great new search engine",
      "slug": "awesome-idea-134",
      "votes_count": 0,
      "day": "2021-05-05",
      "category_id": null,
      "created_at": "2021-05-05T04:39:20.518-07:00",
      "current_user": {
        "voted_for_post": false,
        "commented_on_post": true
      },
      "discussion_url": "http://www.producthunt.com/posts/awesome-idea-134?utm_campaign=producthunt-api\u0026utm_medium=api\u0026utm_source=Application%3A+Awesome+Oauth+App+%2389+%28ID%3A+1279%29",
      "exclusive": null,
      "featured": true,
      "ios_featured_at": false,
      "maker_inside": false,
      "makers": [],
      "platforms": [],
      "redirect_url": "http://www.producthunt.com/r/8a3e642aceb814/1543?app_id=1279",
      "screenshot_url": {
        "300px": "http://placehold.it/850x850.png",
        "850px": "http://placehold.it/850x850.png"
      },
      "thumbnail": {
        "id": 1599,
        "media_type": "image",
        "image_url": "https://ph-files.imgix.net/aa1316b9-e928-4502-9233-0ebf2c246e20?auto=format\u0026fit=crop\u0026h=570\u0026w=430",
        "metadata": {}
      },
      "topics": [],
      "user": {
        "id": 10309,
        "created_at": "2021-05-05T04:39:20.497-07:00",
        "name": "Karl User the 833th",
        "username": "producthunter829",
        "headline": "Product Hunter",
        "twitter_username": "hunter833",
        "website_url": "http://awesome.io",
        "profile_url": "http://www.producthunt.com/@producthunter829",
        "image_url": {
          "30px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "32px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "40px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "44px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "48px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "50px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "60px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "64px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "73px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "80px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "88px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "96px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "100px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "110px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "120px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "132px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "146px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "160px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "176px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "220px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "264px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "32px@2X": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "40px@2X": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "44px@2X": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "88px@2X": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "32px@3X": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "40px@3X": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "44px@3X": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "88px@3X": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "original": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress"
        }
      }
    },
    "user": {
      "id": 10313,
      "created_at": "2021-05-05T04:39:20.547-07:00",
      "name": "Karl User the 837th",
      "username": "producthunter833",
      "headline": "Product Hunter",
      "twitter_username": "hunter837",
      "website_url": "http://awesome.io",
      "profile_url": "http://www.producthunt.com/@producthunter833",
      "image_url": {
        "30px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
        "32px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
        "40px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
        "44px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
        "48px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
        "50px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
        "60px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
        "64px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
        "73px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
        "80px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
        "88px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
        "96px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
        "100px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
        "110px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
        "120px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
        "132px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
        "146px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
        "160px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
        "176px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
        "220px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
        "264px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
        "32px@2X": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
        "40px@2X": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
        "44px@2X": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
        "88px@2X": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
        "32px@3X": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
        "40px@3X": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
        "44px@3X": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
        "88px@3X": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
        "original": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress"
      }
    }
  }
}