Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 5 years ago.
Improve this question
I have a problem with receiving subscriber views.
After passing the authorization and receiving the access token, I want to get the number of views of my youtube channel. But I get the following answer from Api:
{
"error": {
"errors": [
{
"domain": "global",
"reason": "forbidden",
"message": "Forbidden"
}
],
"code": 403,
"message": "Forbidden"
During authorization I use the following scopes:
https://www.googleapis.com/auth/yt-analytics.readonly
https://www.googleapis.com/auth/youtube
My request to Youtube Analytics:
$root = 'https://www.googleapis.com/youtube/analytics/v1/reports?';
$params = [
'ids' => 'channel=='.$my_channel_id,
'dimensions' => 'day,subscribedStatus',
'start-date' => $start_date,
'end-date' => $end_date,
'filters' => 'subscribedStatus==SUBSCRIBED',
'metrics' => 'views',
'access_token' => $my_access_token,
];
$prms = $params;
$params = http_build_query($params);
$request = $root.$params;
$res = $this->requestAPI($request);
So, youtube api has some limitation on issuing information related to subscribers. The actant from which information is taken must have a certain number of subscribers. The exact amount I do not know, but maybe it equals 500
Related
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 8 days ago.
This post was edited and submitted for review 5 days ago.
Improve this question
I am expecting to get all of the details of an specific successfully created event in a JSON format.
I am executing this HTTPS GET request with the URI:
https://graph.microsoft.com/v1.0/users/{user_id}/calendars/{calendar_id}/events/{event_id}
with header:
{"Authorization": "Bearer {token}"}
No request body added
{user_id} , {calendar_id} , {event_id} & {token} all valid and verified, checked multiple times on Microsoft Graph Explorer.
Following the instructions from:
https://learn.microsoft.com/en-us/graph/api/calendar-list-events?view=graph-rest-1.0&tabs=http
I'm expecting a json like this example taken from documentation:
{
"value": [
{
"originalStartTimeZone": "originalStartTimeZone-value",
"originalEndTimeZone": "originalEndTimeZone-value",
"responseStatus": {
"response": "",
"time": "datetime-value"
},
"iCalUId": "iCalUId-value",
"reminderMinutesBeforeStart": 99,
"isReminderOn": true
}
]
}
However I get the following error in the response using Postman as previously hinted:
{
"error": {
"code": "ErrorAccessDenied",
"message": "Access is denied. Check credentials and try again."
}
}
with status: 403 Forbidden
The Roles inside the claim of my token are:
User.ReadBasic.All
Chat.UpdatePolicyViolation.All
TeamsAppInstallation.ReadWriteAndConsentSelfForChat.All
ExternalItem.ReadWrite.OwnedBy
Schedule.ReadWrite.All
Calls.JoinGroupCall.All
OnlineMeetings.Read.All
Mail.ReadWrite
TeamsTab.ReadWriteForChat.All
TeamsAppInstallation.ReadForChat.All
OnlineMeetings.ReadWrite.All
User.ReadWrite.All
OnlineMeetingArtifact.Read.All
BookingsAppointment.ReadWrite.All
Calendars.Read
Mail.ReadBasic.All
ChatMember.ReadWrite.All,People.Read.All
Calls.InitiateGroupCall.All
TeamsAppInstallation.ReadWriteSelfForChat.All
MailboxSettings.Read
Calls.JoinGroupCallAsGuest.All
Bookings.Read.All
CallRecords.Read.All
Chat.ReadWrite.WhereInstalled
ChatMessage.Read.All
User.Read.All
OnlineMeetingTranscript.Read.All
Chat.Read.WhereInstalled
Schedule.Read.All
Calendars.ReadBasic.All
TeamsTab.ReadWriteSelfForChat.All
Mail.Read
Chat.Read.All
ExternalItem.Read.All
Chat.ReadBasic.WhereInstalled
Calendars.ReadWrite
Mail.Send
Chat.ReadWrite.All
MailboxSettings.ReadWrite
Mail.ReadBasic
ChatMember.ReadWrite.WhereInstalled
Chat.ReadBasic.All
Calls.AccessMedia.All
TeamsAppInstallation.ReadWriteForChat.All
ChatMember.Read.All
ChatMember.Read.WhereInstalled
Calls.Initiate.All
ExternalItem.ReadWrite.All,Chat.Create
TeamsAppInstallation.ReadWriteAndConsentForChat.All
I have also consented to all of the previous roles as Application and delegated permissions (if possible) with granted status.
I get the same error on graph explorer using the uri:
https://graph.microsoft.com/v1.0/me/events/{event_id}
I would much appreciate any assistance.
Update 1
audience in the access token
Update 2
I have already created a second app revoked and regranted all the necessary permission,execting the request, getting the same error.
Update 3
I have already created a second app granting it only the mandatory permissions,execting the request, getting the same error.
Hello Everyone,
I am trying to fetch all the office 365 groups using MS Graph API by using PHP Curl.
Below is my code as,
$ch = curl_init('https://graph.microsoft.com/v1.0/groups');
curl_setopt_array($ch, array(
CURLOPT_HTTPHEADER => array('Authorization: Bearer '.$accessToken, 'Content-Type: application/json;'),
CURLOPT_RETURNTRANSFER =>true,
CURLOPT_VERBOSE => 1,
CURLOPT_POST => 1,
CURLOPT_POSTFIELDS => json_encode(array('securityEnabledOnly'=>true))
));
$out = curl_exec($ch);
curl_close($ch); print_r($out);
OUTPUT:
{
"error": {
"code": "Request_BadRequest",
"message": "A value is required for property 'displayName' of resource 'Group'.",
"innerError": {
"request-id": "0961dd91-37ec-48d6-99bc-47f9e4b1d989",
"date": "2018-03-08T08:31:09"
}}}
I am using the same access token for fetching details by other MS Graph API's which are working fine but in this case, I get this error. Also, my tenant is approved for all users via admin consent.
Please help me in this as now I've no clue how to proceed.
The root of my issue (calling List Users) was that I was using POST and not GET, I see in the documentation that List Groups is supposed to be a GET as well. Using POST results in "A value is required for property '_______' of resource"
Getting a strange error message and there is literally nothing on it anywhere I look. Granted access to Google My Business API, followed directions here;
https://developers.google.com/my-business/content/get-started
All went well, but the expected 200 response was actually the below;
{
"error": {
"status": "PERMISSION_DENIED",
"message": "The request was blocked. Quota configuration not found for the requesting project.",
"code": 403,
"details": [
{
"violations": [
{
"description": "The request was blocked. Quota configuration not found for the requesting project.",
"subject": "project:XXXXXXXXXX"
}
],
"#type": "type.googleapis.com/google.rpc.QuotaFailure"
}
]
}
}
Anyone have any idea how to add quotas in Google Developer console, or, alternately, if this message is a result of expired permissions perhaps? (Granted access in Feb, did not use until now?)
This is what you get when the project in question does not have Google My Business API access, as granted through their official process etc. When I used the correct project I got a 200 and all is well.
So sayeth the GMB folks themselves, who answered my email same day!
I have managed to get a valid OAuth 2 token using the Google API for Youtube, but for some reason when making a request, either in my code (PHP) or in the test tools within the Youtube API (for example : https://developers.google.com/oauthplayground/) , I keep getting the following error :
[errors] => Array(
[0] => Array(
[domain] => youtube.header
[reason] => youtubeSignupRequired
[message] => Unauthorized
[locationType] => header
[location] => Authorization
)
)
[code] => 401
[message] => Unauthorized
OR
{
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "accessNotConfigured",
"message": "Access Not Configured"
}],
"code": 403,
"message": "Access Not Configured"
}
}
Can anyone please advise ?
Thank you in advance.
This probably means you have not yet enabled the YouTube Data API. 401 and 403 mean completely different things, however, so here's a checklist of things I would look for:
Verify that you have enabled the YouTube Data API in the Google API Console. It'll be under "Services". You'll need to flip them on. We did a short video tutorial about how to enable and retrieve developer keys.
If you're making an API call to upload videos or edit playlists, you'll need the account you're authorizing as to have a linked channel.
When these are done, you'll be able to download and run the PHP samples. We have a tutorial video for that as well.
I am getting invalid combination of search filter error while retrieving the HD videos. this was the url - https://www.googleapis.com/youtube/v3/search?part=snippet&q=drama&videoDefinition=high&key={Developerkey}
Error report
{
"error": {
"errors": [
{
"domain": "youtube.search",
"reason": "invalidSearchFilter",
"message": "Invalid combination of search filters and/or restrictions.",
"locationType": "parameter",
"location": ""
}
],
"code": 400,
"message": "Invalid combination of search filters and/or restrictions."
}
}
Is it possible to retrieve HD videos? Please guide me. How can I get a response from this URL? Thanks
You also need to include the type=video query parameter, since filtering on high definition only makes sense when the results are limited to videos.
That being said, the error message that's returned isn't actually helpful, and I'll ask the engineering team to revise it so that it clarifies what's wrong.