Getting Error 403: Access Not Configured. Please use Google Developers Console to activate the API for your project
Asked Answered
E

14

63

I am trying to use the Youtube API to pull in all the videos from a particular channel. I set up the project in Google Developers Console and got an API browser key. I enabled YouTube Data API v3 and for safe measure, I enabled YouTube Analytics API.

I do not know what I am getting this error. Can anyone help me.

{
 "error": {
  "errors": [
   {
    "domain": "usageLimits",
    "reason": "accessNotConfigured",
    "message": "Access Not Configured. Please use Google Developers Console to activate the API for your project."
   }
  ],
  "code": 403,
  "message": "Access Not Configured. Please use Google Developers Console to activate the API for your project."
 }
}

Code i'm using. It doesn't do anything yet, just try to fetch the data.

jQuery.getJSON('https://www.googleapis.com/youtube/v3/channels?part=UncleBens&id=UncleBens&key=AIzaSyDXD80S1mFHH2HSZFxLemkae-_Cl_nY5Xk', function(data){
    console.log(data);
    for(var i=0; i<data.data.items.length; i++) {
       console.log(data.data.items[i].title); // title
       console.log(data.data.items[i].description); // description
    }
});
Earlineearls answered 4/4, 2014 at 18:10 Comment(2)
can you post some code?Herewith
The API must be enabled. console.developers.google.com/apis/api/customsearch/overview There will be a button "Enable API". (For new users)Maroc
H
52

Try setting the "Referers" to "Any referer allowed" for your project (just leave the field empty) in the Google Developers Console if it is not already like that.

To do this, go to your Google Developers Console and open API & Auth / Credentials and click "Edit allowed referers" empty the input field.

Heedful answered 4/4, 2014 at 20:35 Comment(6)
That worked, but I don't understand why. Can you explain why that worked? Is it because the call was coming from the user, not the server that has the domain name?Earlineearls
I think it works as a whitelist, anything not on it is blocked. Also I would create a new key and delete this one since other people could use up your quota.Heedful
It worked for me. But we have to remember to keep our API key private.Grillwork
The solution bellow (@Reality) is what helped me. I actually didn't need to create any Public API access keys or change the referrers option. All I need to do is enable the APIs.Tubb
I can't find this option "Edit allowed referrers". It is about an hour trying to find this link, or any thing may be relevant, but in vain.Ivey
This one is NOT the correct answer. The problem is that API is just not enabled in the console. The answer by Omer Aslam is the correct one.Carlo
R
150

You must enable a couple of API (in new google console) for things to work as expected.

Go to https://console.developers.google.com and make sure under "APIs" that you have following APIs enabled:

  1. "Contacts API"
  2. "Google+ API"
Royal answered 28/5, 2014 at 6:46 Comment(11)
I had trouble using Google Play Services for the function hide for the Web platform. I kept getting this 403 error. Enabling those 2 APIs and having "Google Play Game Services" and "Google Play Game Management" enabled seemed to solve my problem.Rica
This also worked for plain OAuth2 authentication i.e. just using Google Accounts for login, rather than accessing any additional services.Tireless
This worked to me, but doesn't make any sense, since i was trying to get "videos uploads" from a peculiar channel.Pontificate
This is the correct answer if you have an error in web and not server application type. @Gsx's answer is for server oneCommunism
thank you! can I ask for a link on how you know that? must be in their docs somewhere....Confer
oh man, i was trying to solve this for 5 hours dude. i had tried everything. i'd buy you a juice if you were here dude.Irksome
this is crazy!! i didnt see this mentioned anywhere obvious. thanks, saved me!Smtih
Google should keep their error messages up to date.Kantian
The key is to enable "Contacts API" as well, which, unlike "Google+ API", is not mentioned in error messages. Thanks man!Lighten
This is the correct answer! Please, make this as correct!Delinquent
i was trying google login authentication, var request = gapi.client.plus.people.get({ 'userId': 'me' }); was getting executed ...but after enabling it workedEyeless
H
52

Try setting the "Referers" to "Any referer allowed" for your project (just leave the field empty) in the Google Developers Console if it is not already like that.

To do this, go to your Google Developers Console and open API & Auth / Credentials and click "Edit allowed referers" empty the input field.

Heedful answered 4/4, 2014 at 20:35 Comment(6)
That worked, but I don't understand why. Can you explain why that worked? Is it because the call was coming from the user, not the server that has the domain name?Earlineearls
I think it works as a whitelist, anything not on it is blocked. Also I would create a new key and delete this one since other people could use up your quota.Heedful
It worked for me. But we have to remember to keep our API key private.Grillwork
The solution bellow (@Reality) is what helped me. I actually didn't need to create any Public API access keys or change the referrers option. All I need to do is enable the APIs.Tubb
I can't find this option "Edit allowed referrers". It is about an hour trying to find this link, or any thing may be relevant, but in vain.Ivey
This one is NOT the correct answer. The problem is that API is just not enabled in the console. The answer by Omer Aslam is the correct one.Carlo
F
14

I faced the same issue. While I am not sure of the reason and logic behind this, but the following steps worked -

1) I left the referers field blank (Any referer allowed). However, this alone did not work. 2) I regenerated the browser key. That did the trick.

Hope this helps.

Footmark answered 6/7, 2014 at 0:10 Comment(0)
B
8

I've faced the same problem just this morning, but I was just trying to login with a google account. I was getting the same exact message.

What worked to me was to put ON this two APIs: Google+ API Contacts API

in your console: https://console.developers.google.com/project/your-project-id/apiui/api

I do not want to empty the "allowed referers field" as I prefer to have under control from where people can login to my app. I didn't have to change my API Key neither. Just for the records, I am using Spring Social Google 1.1.0

Bickering answered 28/8, 2014 at 14:9 Comment(1)
Thank you! This one is the one that saved me! :) I am using Analytics Dashboard Plugin for Wordpress and the changes you suggested got the plugin working :)Enmity
A
4

I had the same problem. I tried emptying the referral list, but that did not fix the problem. Then I regenerated the key. The new key gave an "expired key" error. So I reverted to the obsolete key, which now worked.

Alenaalene answered 20/7, 2014 at 6:24 Comment(0)
B
4

I encountered the same issue when I was using the Management API of Google Analytics. Here's what worked for me:

  1. Make sure the following APIs are enabled in your API console:

    • YouTube Data API v3
    • YouTube Analytics API
    • Contacts API
    • Google+ API
  2. Make sure the the scopes required by the API properly defined in your application. For Youtube, use scopes required to access API calls yuo

  3. Make sure the CLIENT_ID and CLIENT_SECRET of the Google Project in your API console are the correct ones defined in your client application.

Bigham answered 30/10, 2014 at 10:9 Comment(0)
A
3

Make sure that the 'Youtube Data API V3' is enabled for your project. You can find it under 'APIs & Auth' -> 'APIs'.
Also, after enabling the Youtube Data APIs for your project, wait for a minute before firing requests using the API key.

Articular answered 21/8, 2014 at 11:42 Comment(0)
V
2

in api's and auth credentials in https://console.developers.google.com just leave the key for server applications Edit allowed ips empty this will work

Vasily answered 3/9, 2014 at 11:14 Comment(0)
E
2

If you use Public API access for action, you must to add your server ip to Allowed IPs list (Select Project -> APIs and Auth -> Credentials). If not, you will get an error as above: "Access Not Configured. Please use Google Developers Console to activate the API for your project."

Please view my attached file to view more enter image description here

Embattled answered 7/11, 2014 at 10:19 Comment(0)
P
1

You must enable a couple API's for things to work as expected.

First go to https://console.developers.google.com and make sure under "APIs" that you have the Contacts API and Google+ API enabled.

Once that is done you should no longer see that error message.

More can be found-

  1. https://github.com/zquestz/omniauth-google-oauth2/issues/111
  2. https://www.joomlapolis.com/forum/6-news-and-publicity/229505-configuring-cb-connect-7x#263260
Phoebe answered 7/9, 2016 at 2:1 Comment(0)
S
0

I ran into this same issue and what worked for me was using a "Server Key" instead of a "Browser Key". Not sure why that would matter since I was making the request from a browser in both cases, but it works :)

Solidarity answered 9/8, 2014 at 2:33 Comment(0)
B
0

Setting "Referers" to "Any referer allowed" for your project (just leave the field blank)

to goes your console (https://console.developers.google.com/project) and open Api & auth >> Credentials and click under the "Edit allowed referers" empty the input field. hard refresh the query

work Fine.

Biplane answered 13/8, 2014 at 9:19 Comment(0)
R
0

I faced the same issue and my problem was because I had different names in my project and Google APIs

This is an example with Android

    public MakeRequestTask(GoogleAccountCredential credential) {
            HttpTransport transport = AndroidHttp.newCompatibleTransport();
            JsonFactory jsonFactory = JacksonFactory.getDefaultInstance();
            mService = new com.google.api.services.calendar.Calendar.Builder(
                    transport, jsonFactory, credential)
                    .setApplicationName("Google Calendar API Example")
                    .build();
        }

Here the name is "Google Calendar API Example"

enter image description here

and the name in Google APIs is "App Example"

To resolve the problem I changed the name in my project to

        public MakeRequestTask(GoogleAccountCredential credential) {
            HttpTransport transport = AndroidHttp.newCompatibleTransport();
            JsonFactory jsonFactory = JacksonFactory.getDefaultInstance();
            mService = new com.google.api.services.calendar.Calendar.Builder(
                    transport, jsonFactory, credential)
                    .setApplicationName("App Example")
                    .build();
        }
Rowley answered 6/7, 2016 at 18:17 Comment(0)
H
0

Ok this is old but I figured this out for my case and I thought it might help others. I went to oauth and it seemed to resolve.

the real issue is that if you use an unrestricted key [and maybe, depepending on the api enabled] have a billing account linked; the api should work. If it works unrestricted, you are on the right track.

Once you restrict it to android it will fail again with that key until you sign your app. The easiest way i found was the use a signing config for the variants under android in the gradle file.

signingConfigs {
    debug {
        storeFile file("/users/xxxxxxxxxx/Android/keystores/google_demos/debugandroid.jks")
        storePassword "xxxxxxxxxx"
        keyAlias "com.example.xxxxxxxxxx"
        keyPassword "xxxxxxxx"
    }
}
Haitian answered 8/4, 2019 at 14:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.