Comments and Comment Threads

comments#create - Create a new 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)
live_event_id The id the LIVE event 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" : "Yay new comment!",
    "post_id" : 40
  }
}

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/"e23a2f4018c0b84670e5191f5609c763"
Cache-Control: max-age=0, private, must-revalidate
Content-Length: 7956

Body

{
  "comment" : {
    "id" : 63,
    "body" : "Yay new comment!",
    "created_at" : "2017-07-13T13:32:00.365-07:00",
    "parent_comment_id" : null,
    "user_id" : 376,
    "subject_id" : 40,
    "child_comments_count" : 0,
    "url" : "http://www.producthunt.com/posts/awesome-idea-133#comment-63",
    "post_id" : 40,
    "subject_type" : "Post",
    "sticky" : false,
    "votes" : 0,
    "post" : {
      "category_id" : 1,
      "comments_count" : 0,
      "day" : "2017-07-13",
      "id" : 40,
      "name" : "Awesome Idea #133",
      "product_state" : "default",
      "tagline" : "Great new search engine",
      "ios_featured_at" : null,
      "created_at" : "2017-07-13T13:32:00.277-07:00",
      "current_user" : {
        "voted_for_post" : false,
        "commented_on_post" : true
      },
      "discussion_url" : "http://www.producthunt.com/posts/awesome-idea-133?utm_campaign=producthunt-api&utm_medium=api&utm_source=Application%3A+Awesome+Oauth+App+%2392+%28ID%3A+42%29",
      "exclusive" : null,
      "featured" : true,
      "maker_inside" : false,
      "makers" : [],
      "platforms" : [],
      "topics" : [],
      "redirect_url" : "http://www.producthunt.com/r/022b9fd508b3b4/40?app_id=42",
      "screenshot_url" : {
        "300px" : "http://placehold.it/850x850.png",
        "850px" : "http://placehold.it/850x850.png"
      },
      "thumbnail" : {
        "id" : 40,
        "media_type" : "image",
        "image_url" : "https://ph-files.imgix.net/cd087697-802c-4a33-b23b-247f1155c608?auto=format&fit=crop&h=570&w=430",
        "metadata" : {}
      },
      "user" : {
        "id" : 372,
        "created_at" : "2017-07-13T13:32:00.257-07:00",
        "name" : "Karl User the 851th",
        "username" : "producthunter847",
        "headline" : "Product Hunter",
        "twitter_username" : "hunter851",
        "website_url" : "http://awesome.io",
        "profile_url" : "http://www.producthunt.com/@producthunter847",
        "image_url" : {
          "30px" : "https://avatars-cdn.producthunt.com/372/original?auto=format&fit=crop&crop=faces&w=30&h=30",
          "32px" : "https://avatars-cdn.producthunt.com/372/original?auto=format&fit=crop&crop=faces&w=32&h=32",
          "40px" : "https://avatars-cdn.producthunt.com/372/original?auto=format&fit=crop&crop=faces&w=40&h=40",
          "44px" : "https://avatars-cdn.producthunt.com/372/original?auto=format&fit=crop&crop=faces&w=44&h=44",
          "48px" : "https://avatars-cdn.producthunt.com/372/original?auto=format&fit=crop&crop=faces&w=48&h=48",
          "50px" : "https://avatars-cdn.producthunt.com/372/original?auto=format&fit=crop&crop=faces&w=50&h=50",
          "60px" : "https://avatars-cdn.producthunt.com/372/original?auto=format&fit=crop&crop=faces&w=60&h=60",
          "64px" : "https://avatars-cdn.producthunt.com/372/original?auto=format&fit=crop&crop=faces&w=64&h=64",
          "73px" : "https://avatars-cdn.producthunt.com/372/original?auto=format&fit=crop&crop=faces&w=73&h=73",
          "80px" : "https://avatars-cdn.producthunt.com/372/original?auto=format&fit=crop&crop=faces&w=80&h=80",
          "88px" : "https://avatars-cdn.producthunt.com/372/original?auto=format&fit=crop&crop=faces&w=88&h=88",
          "96px" : "https://avatars-cdn.producthunt.com/372/original?auto=format&fit=crop&crop=faces&w=96&h=96",
          "100px" : "https://avatars-cdn.producthunt.com/372/original?auto=format&fit=crop&crop=faces&w=100&h=100",
          "110px" : "https://avatars-cdn.producthunt.com/372/original?auto=format&fit=crop&crop=faces&w=110&h=110",
          "120px" : "https://avatars-cdn.producthunt.com/372/original?auto=format&fit=crop&crop=faces&w=120&h=120",
          "132px" : "https://avatars-cdn.producthunt.com/372/original?auto=format&fit=crop&crop=faces&w=132&h=132",
          "146px" : "https://avatars-cdn.producthunt.com/372/original?auto=format&fit=crop&crop=faces&w=146&h=146",
          "160px" : "https://avatars-cdn.producthunt.com/372/original?auto=format&fit=crop&crop=faces&w=160&h=160",
          "176px" : "https://avatars-cdn.producthunt.com/372/original?auto=format&fit=crop&crop=faces&w=176&h=176",
          "220px" : "https://avatars-cdn.producthunt.com/372/original?auto=format&fit=crop&crop=faces&w=220&h=220",
          "264px" : "https://avatars-cdn.producthunt.com/372/original?auto=format&fit=crop&crop=faces&w=264&h=264",
          "32px@2X" : "https://avatars-cdn.producthunt.com/372/original?auto=format&fit=crop&crop=faces&w=64&h=64",
          "40px@2X" : "https://avatars-cdn.producthunt.com/372/original?auto=format&fit=crop&crop=faces&w=80&h=80",
          "44px@2X" : "https://avatars-cdn.producthunt.com/372/original?auto=format&fit=crop&crop=faces&w=88&h=88",
          "88px@2X" : "https://avatars-cdn.producthunt.com/372/original?auto=format&fit=crop&crop=faces&w=176&h=176",
          "32px@3X" : "https://avatars-cdn.producthunt.com/372/original?auto=format&fit=crop&crop=faces&w=96&h=96",
          "40px@3X" : "https://avatars-cdn.producthunt.com/372/original?auto=format&fit=crop&crop=faces&w=120&h=120",
          "44px@3X" : "https://avatars-cdn.producthunt.com/372/original?auto=format&fit=crop&crop=faces&w=132&h=132",
          "88px@3X" : "https://avatars-cdn.producthunt.com/372/original?auto=format&fit=crop&crop=faces&w=264&h=264",
          "original" : "https://avatars-cdn.producthunt.com/372/original?auto=format&fit=crop&crop=faces&w=original&h=original"
        }
      },
      "votes_count" : 0
    },
    "user" : {
      "id" : 376,
      "created_at" : "2017-07-13T13:32:00.328-07:00",
      "name" : "Karl User the 855th",
      "username" : "producthunter851",
      "headline" : "Product Hunter",
      "twitter_username" : "hunter855",
      "website_url" : "http://awesome.io",
      "profile_url" : "http://www.producthunt.com/@producthunter851",
      "image_url" : {
        "30px" : "https://avatars-cdn.producthunt.com/376/original?auto=format&fit=crop&crop=faces&w=30&h=30",
        "32px" : "https://avatars-cdn.producthunt.com/376/original?auto=format&fit=crop&crop=faces&w=32&h=32",
        "40px" : "https://avatars-cdn.producthunt.com/376/original?auto=format&fit=crop&crop=faces&w=40&h=40",
        "44px" : "https://avatars-cdn.producthunt.com/376/original?auto=format&fit=crop&crop=faces&w=44&h=44",
        "48px" : "https://avatars-cdn.producthunt.com/376/original?auto=format&fit=crop&crop=faces&w=48&h=48",
        "50px" : "https://avatars-cdn.producthunt.com/376/original?auto=format&fit=crop&crop=faces&w=50&h=50",
        "60px" : "https://avatars-cdn.producthunt.com/376/original?auto=format&fit=crop&crop=faces&w=60&h=60",
        "64px" : "https://avatars-cdn.producthunt.com/376/original?auto=format&fit=crop&crop=faces&w=64&h=64",
        "73px" : "https://avatars-cdn.producthunt.com/376/original?auto=format&fit=crop&crop=faces&w=73&h=73",
        "80px" : "https://avatars-cdn.producthunt.com/376/original?auto=format&fit=crop&crop=faces&w=80&h=80",
        "88px" : "https://avatars-cdn.producthunt.com/376/original?auto=format&fit=crop&crop=faces&w=88&h=88",
        "96px" : "https://avatars-cdn.producthunt.com/376/original?auto=format&fit=crop&crop=faces&w=96&h=96",
        "100px" : "https://avatars-cdn.producthunt.com/376/original?auto=format&fit=crop&crop=faces&w=100&h=100",
        "110px" : "https://avatars-cdn.producthunt.com/376/original?auto=format&fit=crop&crop=faces&w=110&h=110",
        "120px" : "https://avatars-cdn.producthunt.com/376/original?auto=format&fit=crop&crop=faces&w=120&h=120",
        "132px" : "https://avatars-cdn.producthunt.com/376/original?auto=format&fit=crop&crop=faces&w=132&h=132",
        "146px" : "https://avatars-cdn.producthunt.com/376/original?auto=format&fit=crop&crop=faces&w=146&h=146",
        "160px" : "https://avatars-cdn.producthunt.com/376/original?auto=format&fit=crop&crop=faces&w=160&h=160",
        "176px" : "https://avatars-cdn.producthunt.com/376/original?auto=format&fit=crop&crop=faces&w=176&h=176",
        "220px" : "https://avatars-cdn.producthunt.com/376/original?auto=format&fit=crop&crop=faces&w=220&h=220",
        "264px" : "https://avatars-cdn.producthunt.com/376/original?auto=format&fit=crop&crop=faces&w=264&h=264",
        "32px@2X" : "https://avatars-cdn.producthunt.com/376/original?auto=format&fit=crop&crop=faces&w=64&h=64",
        "40px@2X" : "https://avatars-cdn.producthunt.com/376/original?auto=format&fit=crop&crop=faces&w=80&h=80",
        "44px@2X" : "https://avatars-cdn.producthunt.com/376/original?auto=format&fit=crop&crop=faces&w=88&h=88",
        "88px@2X" : "https://avatars-cdn.producthunt.com/376/original?auto=format&fit=crop&crop=faces&w=176&h=176",
        "32px@3X" : "https://avatars-cdn.producthunt.com/376/original?auto=format&fit=crop&crop=faces&w=96&h=96",
        "40px@3X" : "https://avatars-cdn.producthunt.com/376/original?auto=format&fit=crop&crop=faces&w=120&h=120",
        "44px@3X" : "https://avatars-cdn.producthunt.com/376/original?auto=format&fit=crop&crop=faces&w=132&h=132",
        "88px@3X" : "https://avatars-cdn.producthunt.com/376/original?auto=format&fit=crop&crop=faces&w=264&h=264",
        "original" : "https://avatars-cdn.producthunt.com/376/original?auto=format&fit=crop&crop=faces&w=original&h=original"
      }
    }
  }
}