I'm having the same problem as a few other people have had here on SO. I can't find a single answer to the problem.
Even though live streaming is clearly enabled and I am streaming live, I get this error from the api.
{
"error": {
"errors": [{
"domain": "youtube.liveBroadcast",
"reason": "liveStreamingNotEnabled",
"message": "The user is not enabled for live streaming.",
"extendedHelp": "https://www.youtube.com/features"
}],
"code": 403,
"message": "The user is not enabled for live streaming."
}
}
This user says that it turned out to be a permissions problem. However, his "answer" does not answer the question. Note that I am trying to use this to access information on my own stream, so I should be able to do it, or grant permission to my app. This question was asking how to access other people's stream data, while I want my own data, therefore not a duplicate. Thanks.
YouTube Streaming API says user is not enabled for live streaming
The YouTube Live Streaming API lets you create, update, and manage live events on YouTube. Using the API, you can schedule events (broadcasts) and associate them with video streams, which represent the actual broadcast content.
There for it would make sense for Google to insist that the authenticating account would have live streaming enabled.
I suggest you check that it is enabled for use with the API. How to enable Live streaming Remember that the YouTube Api authentication is channel based. When the user authenticated they had to pick a channel. Could they have picked one that did not have live streaming enabled. Remember you will only have access to the one channel. If the user has more the one channel you will need to authenticate to each one.
While I do agree it seams strange if all you are going to do is list things that you would need to have live streaming enabled this appears to be the way the API works.
Personally i would like to see a public request that would let yous each for others live streams but again that doesn't appear to work with this api. I have logged this as an issue / feature request. Live Streaming API: live streaming not enabled
Related
I am getting 404 from accouts list function by using google api client.
I have already access token by using OAuth2.0.
In addition to this, I already enable the Google My Business API via https://console.developers.google.com for OAuth 2.0.
â– Here is environemnt
PHP 7.2.3
Ubuntu 18.04 LTS
google/apiclient ^2.5
The function I want to execute is as following.
https://developers.google.com/my-business/reference/rest/v4/accounts/list
I install google client libray by using composer from following link.
https://github.com/googleapis/google-api-php-client
Since google my business library is seprated, I use this program.
https://developers.google.com/my-business/samples
The steps to produce 404 is...
$client = new \Google_Client();
$client->setApplicationName("post_dev"); // app name
$client->setApprovalPrompt('force');
$client->setAccessType('offline');
$client->setAccessToken($credential);
$client->addScope("https://www.googleapis.com/auth/business.manage");
$client->addScope("https://www.googleapis.com/auth/plus.business.manage");
$gmbService = new \Google_Service_MyBusiness($client);
$results = $gmbService->accounts->listAccounts();
The variable $credential has following values.
client_id
client_secret
access_token
expires_in
refresh_token
After executing program, I am getting 404 erros like follwoing.
Google_Service_Exception[
404
]: {
"error": {
"code": 404,
"message": "Method not found.",
"errors": [
{
"message": "Method not found.",
"domain": "global",
"reason": "notFound"
}
],
"status": "NOT_FOUND"
}
}
It happens because you are trying to interact with the Google My Business API using a non-whitelisted project.
I faced the same issue. In my case, I submitted my project for whitelisting to unlock Google My Business API library.
Then, a couple weeks after that I created a new project under the same Google Cloud Platform account, just to set a more appropriate name. HERE was the root of the issue!
Even if you see the GMB library enabled at the account level, it works only at the PROJECT level. That's why you are getting 404 errors.
So, I switched everything to my original project (Consent screen settings, Oauth clients, etc)... The same on my localhost application, developed with Laravel Lumen 7.
After these couple changes, everything worked fine!
NOTE: Google allows you to whitelist 1 project per account ONLY! If your project/application were approved by Google, USE IT! Instead creating new ones.
This error has nothing to do with your access token. It cant find the method you are using. Google_Service_MyBusiness is not part of the Google api php client library.
The my Business API is unlike the other apis, it is not listed in the API directory available through the Discovery API and it requires a developer key and project acceptance into My Business. There for it cant be generated when the library generation script runs.
Im going though some channels to get that documentation page updated.
note from team Nov 1, 2018
There is a tool on the way that will help developers maintain their own version of such service classes. When it is ready and you have a project with My Business enabled you should be able to run:
export API_KEY=yourkey
bin/generate 'https://mybusiness.googleapis.com/$discovery/rest?version=v4&key=$API_KEY' generated-output
and then you can move the contents of generated-output/mybusiness-v4 anywhere you want in your include path.
That discovery URL has been known to change as new versions come out so keep and eye on https://developers.google.com/my-business/reference/rest/
Im waiting to hear the status of this.
The reason why I could not call the API is "my company already has a whitelisted project to access the Google My Business API. At this time, they are only whitelisting one project per business.". Therefore, I could not call API.
So far I'm able to use the PHP Library here - https://developers.google.com/my-business/samples/previousVersions
But the answer above was a huge help - I had EXACTLY the same issue, had "tidied up" my projects - after being granted access to the Google My Business API and seeing it available for my other projects I assumed incorrectly that my other projects would be able to use it - wrong! Very glad I found the answer here. Luckily I was able to restore the project I'd deleted, and using that one it worked straight away.
Following Google's documentation you should be able to use the YouTube Reporting API without user authentication by using a Service Account.
Currently I have a very simple sample that should give me a list of available Jobs, could be empty though. But I get a 403 permission denied.
Request:
$client = new \Google_Client();
$client->setAuthConfig('service-account-key.json');
$client->addScope(Google_Service_YouTubeReporting::YT_ANALYTICS_MONETARY_READONLY);
$client->addScope(Google_Service_YouTubeReporting::YT_ANALYTICS_READONLY);
$youtube_reporting_service = new \Google_Service_YouTubeReporting($client);
$jobs = $youtube_reporting_service->jobs->listJobs();
Response:
Google_Service_Exception
{
"error": {
"code": 403,
"message": "The caller does not have permission",
"errors": [
{
"message": "The caller does not have permission",
"domain": "global",
"reason": "forbidden"
}
],
"status": "PERMISSION_DENIED"
}
}
I verified that the following APIs were enabled:
YouTube Reporting API
YouTube Data API v3
YouTube Analytics API
Google+ API (Having my doubts on this one if that is really necessary)
The thing I don't understand is how the relation should be between projects in Google Cloud Platform and the YouTube accounts.
Has this to do with Delegating domain-wide authority to the service account?
Are you then required to have G Suite enabled?
I see a similar question How to grant access to Youtube Reporting API for a google service account?
exists, but that one may be a bit aged since the last response. I hope my samples and additions will shine a new light over this question.
Is there someone with a working sample? May be in other languages. As long as the flow is clear.
In general, service accounts can be used to impersonate a user account. Making authorized calls is mentioned in Preparing to make an authorized API call.
But to answer the question, Service Accounts do not work with the YouTube API:
Service accounts do not work for YouTube Data API calls because
service accounts require an associated YouTube channel, and you cannot
associate new or existing channels with service accounts. If you use a
service account to call the YouTube Data API, the API server returns
an error with the error type set to unauthorized and the reason set to
youtubeSignupRequired.
I've been struggling quite a bit to solve the this issue. Basically, I'm just trying to connect to my youtube channel and get a list of future and past live broadcasts from my PHP based application. I was able to create a service account on the api console and it seems to be working fine now (as I've had some oauth authentication errors before) but now, I'm receiving this error in my error log:
Uncaught exception 'Google_Service_Exception' with message 'Error calling GET
https://www.googleapis.com/youtube/v3/liveBroadcasts?part=id%2Csnippet&mine=true:
(403) The user is not enabled for live streaming.' in etc...
My youtube account is associated with my personal #gmail.com account. I'm assuming that somehow I have to add the #developer.gserviceaccount.com to my youtube channel but even though I've tried to find any instructions for this, I was not able to find. I have live streaming enabled on my personal gmail account and also have some test events there.
Would appreciate and help in this matter please. Thanks!
Not sure if this will help, but in my case it turned out to be that the account somehow had 2 accounts:
a page with a strange page-id#pages.plusgoogle.com and
a normal Google email account user#gmail.com).
On top of that, I had issues with not renewing the access token: e.g sending an old access token.
Make sure you try the 2 sub accounts; one must have the videos under it. If you choose the wrong one, then you get that error above.
I am implemented In App Billing for android.I wanted to implement subscription validity checking through my backend server. As Google Play Documentation, for making call for Google Play API,need authentication using oauth 2.0.
I followed instructions for registering project and creating credentials. But from there I have no idea how to use those credentials, I tried authentication via CURL request, but it asking permission as shown in follwing image
This permissions works fine I can exchange code and get access token, but all this done by manually, how should I implement this on backend.
I even try to use google api php library provided by Google, but It adds confusion. Also they didn't provide any example, how to use library.
Can anybody elaborate how exactly use library or pure php?
Thanks in advance.
To perform LVL and/or IAB validation on a server, do not access Google servers directly from the server. Even if all information were available, you would face integrity problems, because your app and your server will see different information due to synchronization latencies.
Instead, use your app as a proxy and validate the Google Play information on your server as described here.
I developed a app to read over someones inbox for keywords. If found to give them a score. It worked fine for awhile however now it does not. WHen I try to manually put in the information into the graph api (https://graph.facebook.com/(id)//threads?access_token=(token)) I get this error:
{
"error": {
"type": "OAuthException",
"message": "(#298) You must be a developer of the application"
}
}
Any ideas on how to fix this issue?
It sounds like your application got disabled, potentially for violating the terms of service. I would contact the Facebook developer team on their Facebook group. I just tested this API call with my own application and it worked just fine with read_mailbox permissions. Try creating a separate application and trying again.