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/
Related
Description: my app uses youtube content id api (https://developers.google.com/youtube/partner/docs/v1) and service account. all resources work fine except whitelist resources (https://developers.google.com/youtube/partner/docs/v1/whitelists/list), 3 months ago I was still able to retrieve the whitelist normally. i also tried it with apis explorer the error is still the same.
API request with parameters used (DO NOT include your credential)
onBehalfOfContentOwner=...........................
Result (copy and paste a JSON response you received): { "error": { "code": 403, "message": "Forbidden", "errors": [ { "message": "Forbidden", "domain": "global", "reason": "forbidden" } ] } }
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 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
I'm trying to delete followiing comment z12mdhjgxrfgtpf3d231jrz5vo3jdj0lo on this video but the response code is 400. I'm using token of the channel's admin with https://www.googleapis.com/auth/youtube.force-ssl scope as it required by documentation.
The request is:
DELETE https://www.googleapis.com/youtube/v3/comments?id=z12mdhjgxrfgtpf3d231jrz5vo3jdj0lo&alt=json
{
"query_params": {
"id": "z12mdhjgxrfgtpf3d231jrz5vo3jdj0lo",
"alt": "json"
}
}
The response:
{
"error": {
"errors": [
{
"domain": "youtube.comment",
"reason": "processingFailure",
"message": "The API server failed to successfully process the request. While this can be a transient error, it usually indicates that the requests input is invalid.",
"locationType": "parameter",
"location": "id"
}
],
"code": 400,
"message": "The API server failed to successfully process the request. While this can be a transient error, it usually indicates that the requests input is invalid."
}
}
What is wrong with the request?
That's token debug info:
{
issued_to: "493985796851.apps.googleusercontent.com",
audience: "493985796851.apps.googleusercontent.com",
user_id: "109704411339866376304",
scope: "https://www.googleapis.com/auth/plus.me https://www.googleapis.com/auth/youtube.force-ssl https://www.googleapis.com/auth/youtube.upload",
expires_in: 2452,
access_type: "offline"
}
The reason you're not able to delete the comment is that you're using Comments.delete to remove comment which was written by other users . Comments.delete only deletes your own comments in your video.
To delete comment of other users, use Comments.setModerationStatus and set moderationStatus to "rejected".
So just repeat what you did but this time using Comments.setModerationStatus. There's a Try-it in the link for testing purposes.
I've been trying to write a little script with Google's API. I've managed to set it up to get the actual access token and echo it in the browser but when i try to:
$views = file_get_contents('https://www.googleapis.com/youtube/analytics/v1/reports?ids=channel%3D%3DMINE&start-date=2014-09-29&end-date=2014-10-29&metrics=views&key={key}');
var_dump($views);
It's still giving me the default error of
{
"error": {
"errors": [
{
"domain": "global",
"reason": "required",
"message": "Login Required",
"locationType": "header",
"location": "Authorization"
}
],
"code": 401,
"message": "Login Required"
}
}
If any more information is needed like my request, please let me know. I feel that maybe i'll be missing something simple like usual :l !!!
Thanks in advance!
The Parameter for the access token is access_token, not key.
Your URL has to be
https://www.googleapis.com/youtube/analytics/v1/reports?ids=channel%3D%3DMINE&start-date=2014-09-29&end-date=2014-10-29&metrics=views&access_token={access_token}