3
votes

I'm using the API explorer at the bottom of https://developers.google.com/youtube/v3/docs/commentThreads/insert to test this call. I am requesting the scope https://www.googleapis.com/auth/youtube.force-ssl. Appreciate any help!

REQUEST:

POST https://www.googleapis.com/youtube/v3/commentThreads?part=id%2Csnippet&fields=id&key={YOUR_API_KEY}
{
 "snippet": {
  "topLevelComment": {
   "snippet": {
    "textOriginal": "comment from gdev"
   }
  },
  "videoId": "B5BypNLbBgQ",
  "channelId": "UCNqqFgLtbSjc9Er7XFv4wbA"
 }
}

RESPONSE:

{
 "error": {
  "errors": [
   {
    "domain": "youtube.commentThread",
    "reason": "forbidden",
    "message": "The comment thread could not be created due to insufficient permissions. The request might not be properly authorized.",
    "locationType": "other",
    "location": "body"
   }
  ],
  "code": 403,
  "message": "The comment thread could not be created due to insufficient permissions. The request might not be properly authorized."
 }
}
3

3 Answers

1
votes

The video was private.... Worked fine on a public video.

0
votes

I had a similar problem. I needed to set the token in the header. the request body needs to have:

part: "snippet"

I think you also would need to set a header of:

Authorization: 'Bearer ' + access_token
0
votes

I uploaded a video and by default the comments were disabled. Once I changed to "Allow all comments" I could post via the API.