Quantcast
Channel: Active questions tagged youtube-api - Stack Overflow
Viewing all articles
Browse latest Browse all 3831

Youtube CommentThreads api Insert not working

$
0
0

I'm trying to Use Youtube api v3 to comment on video and getting this error but my request data is correct according to documentation.Here is my code.Using oauth the code setting access_token like this

oauth.setCredentials(tokens);

 var channelId = "UCq-Fj5jknLsUf-MWSy4_brA";                var request = Youtube.commentThreads.insert({"part": ["snippet"                          ],"resource": {"snippet": {"videoId": "qfuFeUnAm8E","topLevelComment": {"snippet": {"textOriginal": "best video"                                                        }                                              },"channelId": channelId                                    }                          }                }, (err, data) => {                          if (err) {                                    console.log(err, 'errerrerr')                          }                          if (data) {                                    console.log(data, 'datadata');                          }                });

This is the error i'm getting in return

  errors: [{  message: "The API server failed to successfully process the request. While this can be a transient error, it usually indicates that the request's input is invalid. Check the structure of the <code>commentThread</code> resource in the request body to ensure that it is valid.",  domain: 'youtube.commentThread',  reason: 'processingFailure',  location: 'body',  locationType: 'other'}

]

This is the authentication or authorization code generating everytime

"tokens": {"access_token": "[redacted]","scope": "https://www.googleapis.com/auth/youtube https://www.googleapis.com/auth/youtubepartner https://www.googleapis.com/auth/youtube.force-ssl https://www.googleapis.com/auth/youtube.upload","token_type": "Bearer","expiry_date": 1655195240477}

Viewing all articles
Browse latest Browse all 3831

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>