youtube quota limit per 100 seconds - youtube-api

I'm calling youtube.liveChat every 2 seconds but I often get the 403 errors.
I've checked that API console's allocation for the API that was "Queries per 100 seconds per user" is 300,000.
How can I allow to call the API every seconds?
Regards.
error:{
"error": {
"code": 403,
"message": "The request was sent too soon after the previous one. This error occurs when API requests to retrieve messages are being sent more frequently than YouTube's refresh rates, which unnecessarily wastes bandwidth and quota.",
"errors": [
{
"message": "The request was sent too soon after the previous one. This error occurs when API requests to retrieve messages are being sent more frequently than YouTube's refresh rates, which unnecessarily wastes bandwidth and quota.",
"domain": "youtube.liveChat",
"reason": "rateLimitExceeded"
}

Related

Insert liveCuePoints in live broadcast - getting error 403 Forbidden

We have a verified app with the following scopes:
https://www.googleapis.com/auth/youtube.force-ssl
https://www.googleapis.com/auth/youtubepartner
https://www.googleapis.com/auth/youtube
This means we can use the YouTube Data API and YouTube Content ID API (for YouTube Partners).
We are trying to do ad inserts (insert LiveCuepoints) for a live broadcast on a YouTube partner channel, which is connected via our verified app. We are getting the following error when we use the LiveCuepoint insert API endpoint:
Request
POST /youtube/partner/v1/liveCuepoints?channelId={channelId}&onBehalfOfContentOwner={contentOwnerId} HTTP/1.1
Authorization: Bearer {accessToken}
Content-Type: application/json; charset=utf-8
Host: www.googleapis.com
Content-Length: 57
{"broadcastId":"{broadcastId}","settings":{"cueType":"ad"}}
Response
{
"error": {
"code": 403,
"message": "Forbidden",
"errors": [
{
"message": "Forbidden",
"domain": "global",
"reason": "forbidden"
}
]
}
}
Other requests (with the same credentials) to the YouTube Content ID API (such as listing contentOwners or listing liveBroadcasts) are working fine and without errors.
We’ve tried debugging this issue for many hours, researched online and tried different solutions but couldn’t get this to work. Is there a special scope, setting or access needed to do ad inserts in a live broadcast? Is anyone having working example code to do liveCuepoint inserts?
For anyone interested: I found the solution.
We connected (via our verified app) as a channel. This was a mistake, you have to authenticate with an account, and this account must have administrator rights.
Now you receive an access token which can access all content owners and channels connected to that account. Inserting liveCuePoints now works fine!

List Channel Messages using Application Permissions

I have an Application which accesses channel messages in Microsoft Teams. We have been using the "Group.Read.All" permission for the last few months to access these messages, but just today we have started getting 403 for these requests? Has something changed?
I appreciate the docs flag this as "Not supported" but it has been working with no issue until today.
We are trying to use the following request;
https://graph.microsoft.com/beta/teams/{id}/channels/{id}/messages
However we are now getting a 403 Forbidden response;
{
"error": {
"code": "UnknownError",
"message": "",
"innerError": {
"request-id": "xxx",
"date": "xxx"
}
}
}
It looks as though Microsoft has locked down these particular permissions and you'll need to request access to them for your particular app. See their documentation here: https://learn.microsoft.com/en-us/graph/teams-protected-apis

Getting error code 200 for google assistant on Raspberry pi 3

I am getting the following errors:
https://embeddedassistant.googleapis.com/v1alpha2/projects/rpiassistant-f01c3/devices/B65EF05D34859770BDEBF646E84D89F1 200
ON_MUTED_CHANGED:
{'is_muted': False}
ON_START_FINISHED
[2509:2526:ERROR:http_client_with_backoff.cc(113)] Retrying request with http_status=200 request_id=0
The above URL returned as follows:
{
"error": {
"code": 403,
"message": "The request is missing a valid API key.",
"status": "PERMISSION_DENIED"
}
}
Please note that I have enabled the API still getting this error please help
HTTP status code 200 is not an error. Rather, it is an indication that the HTTP request was successful.
When the sample is making that call, it includes authorization that tells the Google Assistant SDK server that it is you making this request. When you just open it up in a browser, the server doesn't know it is you and returns a 403 for unauthorized access.
AFAIK, this is working as intended and you should be able to run the sample without issue.

Microsoft Graph Webhook Missing ClientState

I am having trouble starting a Microsoft Graph webhook subscription (for a mailbox in particular). When initiating the subscription it appears as though Microsoft accepts all of the parameters I am sending to configure the subscription but fails the total subscription because it is receiving a non 2xx response from the endpoint I have configured.
The reason my endpoint is sending a 401 back to Microsoft is because their POST that includes the subscription validation token is missing the clientState.
I am using the clientState key-value pair to authenticate all the communication between Microsoft and my endpoint. If my endpoint does not see the correct clientState it will return a 401.
Any ideas on what I might be missing or if I should go about this in a different way? In my opinion allowing my endpoint to accept unauthenticated GET/POST's is not an option.
Example request body using POST method including the API key in the header:
{
"changeType": "created",
"clientState": "testClientState",
"resource": "users/<UserName>/messages",
"expirationDateTime": "2017-08-10T10:24:57.0000000Z",
"notificationUrl": "<EndpointURL>"
}
Error Returned from Microsoft:
"error": {
"code": "InvalidRequest",
"message": "Subscription validation request failed. Must respond with 200 OK to this request.",
"innerError": {
"request-id": "adf7fc7b-6b14-4422-8526-c1391be8dd27",
"date": "2017-08-07T16:24:59"
}
}
I understand everything to work as intended until my endpoint is sent the validation token because I receive the validation token but my endpoint rejects it because it is missing the client state.
Endpoint Log Snippet:
queryStringParameters": {
"validationToken": "<ValidationToken sent by Microsoft>"
}
I am basing my API endpoint logic off of some of Microsoft's developer guides. For the subscription creation in particular I am using this guide.
It appears this question was also asked but not answered on GitHub.
I represent Microsoft Graph Web hooks team ...
We verified your request in our MS Graph Service logs and confirmed that it was failed at Subscription validation phase because of HTTP status code='Unauthorized' from your endpoint ... Up to this everything is correct per your observation ...
By design, MS Graph Web hooks do not send the clientState header as part of the Subscription validation request. Please do not expect for this header during the subscription validation.
More information
You would have expected to receive the clientState as part of the validation request header because Office365 graph sends it https://msdn.microsoft.com/en-us/office/office365/api/notify-rest-operations. Office 365 Graph different from MS Graph ...
There are some document improvements observed with this question at https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/api/subscription_post_subscriptions ... Example Publisher Notification Payload, which is after successful subscription is mentioned together with the Subscription validation … We fixed those.

I am getting a 403 error: "domain": "usageLimits", "reason": "ipRefererBlocked", in YouTube Data API v.3

I am getting a 403 error:
"domain": "usageLimits", "reason": "ipRefererBlocked", in YouTube Data API v.3
With the following call:
https://www.googleapis.com/youtube/v3/playlistItems?part=snippet%2CcontentDetails&maxResults=50&playlistId=PLSnMNeASC5B5RBEBJClz6DdLEa-W9TM7t&key=AIzaSyAplIcFznd1OxBaMWM2LBN9uLBOVITMYxs
Also tried
https://www.googleapis.com/youtube/v3/playlistItems?part=snippet%2CcontentDetails&maxResults=50&playlistId=PLSnMNeASC5B5RBEBJClz6DdLEa-W9TM7t&clientId=200447294473-i5a20md5sgpq20mai9ob2tiib8nqln9t.apps.googleusercontent.com
and getting this error:
"domain": "usageLimits",
"reason": "dailyLimitExceededUnreg",
"message": "Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup.",
"code": 403,
API and credentials are authorized and within daily quota, intact, below 0.07/sec/day.
Could you please provide some assistance?
I was facing similar issue while integrating to wordpress. Below listed are the fix/ mistakes I made, may help you.
ensure YouTube API is enabled
initially remove any domain restrictions from "Accept requests from these HTTP referrers (web sites)". later once its working u can add DOMAIN name
generate and use "browser" type key if integrating to website.
You need to change/set Browse key instead of android Key.
Also you need to checked the section Accept requests from these HTTP referrers (web sites) from Google Developers Console > API Manager > Credentials
to accept all requests from your website(or domain) add this lines to Website restrictions area in google cloud api restriction screen
Any subdomain or path URLs in a single domain, using wildcard asterisks (*):
*.example.com/*
http://*.example.com/*
https://*.example.com/*

Resources