I am trying to call the following url with my access token which is for getting comments from a video but it doesn't seem to work and gives me a Insufficient Permissions Error.
Here's the URL I try to call-
https://www.googleapis.com/youtube/v3/commentThreads?part=snippet&maxResults=1&videoId=tdUX3ypDVwI&access_token={myAccessToken}
but it sends me the following error:
{
"error": {
"errors": [
{
"domain": "global",
"reason": "insufficientPermissions",
"message": "Insufficient Permission"
}
],
"code": 403,
"message": "Insufficient Permission"
}
}
Apparently, It doesn't make sense to me? Please help.
You need the following scope :
https://www.googleapis.com/auth/youtube.force-ssl
Related
When we are are trying to fetch data from youtube monetisation metrics api endpoint for an account, but it is providing us with a** forbidden error**. We have also checked for monetaryanalytics scope for that account and it is available in account-props.
We have been receiving a forbidden error without any other error message to act further upon it
Adding the API response here:
{
"error": {
"code": 403,
"message": "Forbidden",
"errors": [
{
"message": "Forbidden",
"domain": "global",
"reason": "forbidden"
}
]
}
}
Can anyone please help on this, any help will be appreciated
I tried this API here and in my code and got this error everywhere. However, other methods, such as commentThreads.insert() or comments.delete(), work fine, so I don't think this issue is scopes or OAuth 2.0 authorization related.
Here is the response I get:
{
"error": {
"code": 403,
"message": "The comment could not be updated due to insufficient permissions. The request might not be properly authorized.",
"errors": [
{
"message": "The comment could not be updated due to insufficient permissions. The request might not be properly authorized.",
"domain": "youtube.comment",
"reason": "forbidden",
"location": "body",
"locationType": "other"
}
]
}
}
UPD:
Apparently, you can only update the comment under your own video. But you can delete your comment from any video. I don’t know why they did it that way and didn't even write about it in the docs. I also wrote to them on https://issuetracker.google.com/
For specific accounts, we are able to fetch data but not able to fetch reporting analytics, I am getting
error { "error": {
"code": 403,
"message": "Forbidden",
"errors": [
{
"message": "Forbidden",
"domain": "global",
"reason": "forbidden"
}
] } }
Account has permissions for accessing reports. But for accounts with same permissions, we are able to fetch insights
API Endpoint: https://youtubeanalytics.googleapis.com/v2/reports
API Request:
https://youtubeanalytics.googleapis.com/v2/reports?access_token=xxxxxxx&dimensions=day&metrics=views%2CredViews%2Ccomments%2Clikes%2Cdislikes%2CvideosAddedToPlaylists%2CvideosRemovedFromPlaylists%2Cshares%2CestimatedMinutesWatched%2CestimatedRedMinutesWatched%2CaverageViewDuration%2CaverageViewPercentage%2CannotationClickThroughRate%2CannotationCloseRate%2CannotationImpressions%2CannotationClickableImpressions%2CannotationClosableImpressions%2CannotationClicks%2CannotationCloses%2CcardClickRate%2CcardTeaserClickRate%2CcardImpressions%2CcardTeaserImpressions%2CcardClicks%2CcardTeaserClicks%2CsubscribersGained%2CsubscribersLost%2CestimatedRevenue%2CestimatedAdRevenue%2CgrossRevenue%2CestimatedRedPartnerRevenue%2CmonetizedPlaybacks%2CplaybackBasedCpm%2CadImpressions%2Ccpm&ids=channel%3D%3DMINE&startDate=2020-06-10&endDate=2020-07-09
This is what im using to add comments to youtube :
gapi.client.youtube.commentThreads.insert({
part: "snippet", commentData
}).then(function (response) {
console.log("response", response);
})
This is what im getting while hit that :
{
"error": {
"errors": [
{
"domain": "global",
"reason": "insufficientPermissions",
"message": "Insufficient Permission: Request had insufficient authentication scopes."
}
],
"code": 403,
"message": "Insufficient Permission: Request had insufficient authentication scopes."
}
}
Insufficient Permission: Request had insufficient authentication scopes.
Means exactly that the currently authenticated user has not granted you the permissions to do that.
If you check the documentation comments.insert you will see that in order to use this method you must have authncated your user with the https://www.googleapis.com/auth/youtube.force-ssl scope
When I try to request infos about a video via the YouTube Data API, I always get a 403 forbidden error:
https://www.googleapis.com/youtube/v3/videos?id={video_id}&key={my_key}&part=snippet,contentDetails,statistics,status,fileDetails
Error message:
{
"error": {
"errors": [
{
"domain": "youtube.common",
"reason": "forbidden",
"message": "Forbidden"
}
],
"code": 403,
"message": "Forbidden"
}
}
I have not restricted any referrers for my key, and the key is valid. Does anybody now why this is not working? I think I sticked to the docs at
https://developers.google.com/youtube/v3/docs/videos/list#try-it
If I omit the fileDetails part, the request resolves fine. Thanks in advance!