Re: "reason": "accessNotConfigured",

378 views
Skip to first unread message

Jeremy Geerdes

unread,
Jul 13, 2012, 11:52:21 AM7/13/12
to google-ajax...@googlegroups.com

This is a fairly common issue. Generally, it's caused by a typo in the API key or a misconfiguration in how you've restricted it. Particularly, check for domain and/or IP address restrictions that may be incorrect.

Also, for future reference, this is a mpderated group. So sometimes, posts - particularly first-time posts - don't show up immediately.

Jg

On Jul 13, 2012 10:44 AM, "Patrick Ziegler" <pzi...@hotmail.com> wrote:

Patrick Ziegler

unread,
Jul 13, 2012, 12:11:24 PM7/13/12
to google-ajax...@googlegroups.com
Yep, after the third post I realized why my posts where delayed...

I am cutting and pasting the key so I don't see how a typo there could be it.  I cannot see where I have any restrictions... The IP in my access setting below is that of our Web server.  

Now sure how the  Referers should be formatted.  And, What would it be if you are just pasting the query url into the address bar ie, no  Referer?



Key for server apps (with IP locking)
API key:
AIzaSyChWV0NI7GTbvnUHr0XzoqWt3HyCyyMTJA
IPs:
66.231.1.171
Activated on:Jul 12, 2012 2:03 PM
Key for browser apps (with referers)
API key:
AIzaSyAdEgxFfgKU525LpJrN1qBg_ZZzfYvmyUU
Referers:
Activated on:Jul 12, 2012 10:00 AM
On Jul 13, 2012 10:44 AM, "Patrick Ziegler" <> wrote:

Jeremy Geerdes

unread,
Jul 13, 2012, 12:24:04 PM7/13/12
to google-ajax...@googlegroups.com

Are you sending the appropriate http_referer headers? This would explain why it doesn't return when you call it directly from the browser. And if you're calling from a server, you would have to explicitly set the header to one of the specified referers.

Jg

--
You received this message because you are subscribed to the Google
Groups "Google AJAX APIs" group.
To post to this group, send email to
google-ajax...@googlegroups.com
To unsubscribe from this group, send email to
google-ajax-searc...@googlegroups.com
To view this message on the web, visit
https://groups.google.com/d/msg/google-ajax-search-api/-/hJZfwgWvWGQJ
For more options, visit this group at
http://groups.google.com/group/google-ajax-search-api?hl=en?hl=en

Patrick Ziegler

unread,
Jul 13, 2012, 12:44:09 PM7/13/12
to google-ajax...@googlegroups.com
Are you sending the appropriate http_referer headers? 

I don't know?  Where do I look?

I am experimenting with this both by browser address bar and via a page on our site with,


echo $page;

The string in this case ends up empty...








On Friday, July 13, 2012 10:52:21 AM UTC-5, jgeerdes [AJAX APIs "Guru"] wrote:
On Jul 13, 2012 10:44 AM, "Patrick Ziegler" <> wrote:

Jeremy Geerdes

unread,
Jul 13, 2012, 12:54:40 PM7/13/12
to google-ajax...@googlegroups.com

Then it is definitely a header issue. With PHP, you willl need to use curl. There used to be some code samples for this, but I don't know that they are still available. Actually, you might want to check out the client library Google has supplied for PHP. Alternatively, you could remove those referer restrictions, but I don't think I would recommend that, especially if you're going to enable billing. (Wouldn't want someone stealing your queries or money!)

Jg

On Jul 13, 2012 11:44 AM, "Patrick Ziegler" <pzi...@hotmail.com> wrote:

Patrick Ziegler

unread,
Jul 13, 2012, 1:00:12 PM7/13/12
to google-ajax...@googlegroups.com
I added my IP to  Key for server apps (with IP locking) and it is now working...  Prior to this I had the Web server IP in this...  I can work with this as we only have a few IP's that will need to access this.  However, I am curious as how one would set it up so any visitor to our site could use the ap...

Thanks for all of your input!

Pat



On Friday, July 13, 2012 11:54:40 AM UTC-5, jgeerdes [AJAX APIs "Guru"] wrote:

Then it is definitely a header issue. With PHP, you willl need to use curl. There used to be some code samples for this, but I don't know that they are still available. Actually, you might want to check out the client library Google has supplied for PHP. Alternatively, you could remove those referer restrictions, but I don't think I would recommend that, especially if you're going to enable billing. (Wouldn't want someone stealing your queries or money!)

Jg

On Jul 13, 2012 11:44 AM, "Patrick Ziegler" <> wrote:

Patrick Ziegler

unread,
Jul 13, 2012, 1:07:49 PM7/13/12
to google-ajax...@googlegroups.com
I have to correct my last post.  From a link or direct address bar input works now but the 


does not...

How does one "Remove Refere restrictions?  This might be an option as it is not a public page and we will not have enabled billing...  

Jeremy Geerdes

unread,
Jul 13, 2012, 1:13:54 PM7/13/12
to google-ajax...@googlegroups.com

If you're going to call it from the client side, you will use the referer restriction method. Restrict it to the servers and domains that will be using it.

If you're calling the API server-side (e.g., from PHP), and it's manageable, then leave it on IP-based restriction.

Jg

--
You received this message because you are subscribed to the Google
Groups "Google AJAX APIs" group.
To post to this group, send email to
google-ajax...@googlegroups.com
To unsubscribe from this group, send email to
google-ajax-searc...@googlegroups.com
To view this message on the web, visit

Patrick Ziegler

unread,
Jul 13, 2012, 1:28:21 PM7/13/12
to google-ajax...@googlegroups.com

I appreciate all of your help.  I think tho that you assume I know more than I do..  I am a learn-as-I-go sort of code writer.  

Let me back up and explain the goal of this project.  All I want to do is display the number of Google indexed pages on a internal Web page for the boss...

From one of your previous post am I to understand that,


won't work?  Or do I have to set up the API access differently?




On Friday, July 13, 2012 12:13:54 PM UTC-5, jgeerdes [AJAX APIs "Guru"] wrote:

If you're going to call it from the client side, you will use the referer restriction method. Restrict it to the servers and domains that will be using it.

If you're calling the API server-side (e.g., from PHP), and it's manageable, then leave it on IP-based restriction.

Jg

On Jul 13, 2012 12:00 PM, "Patrick Ziegler" <pzi...@hotmail.com> wrote:
I added my IP to  Key for server apps (with IP locking) and it is now working...  Prior to this I had the Web server IP in this...  I can work with this as we only have a few IP's that will need to access this.  However, I am curious as how one would set it up so any visitor to our site could use the ap...

Thanks for all of your input!

Pat



On Friday, July 13, 2012 11:54:40 AM UTC-5, jgeerdes [AJAX APIs "Guru"] wrote:

Then it is definitely a header issue. With PHP, you willl need to use curl. There used to be some code samples for this, but I don't know that they are still available. Actually, you might want to check out the client library Google has supplied for PHP. Alternatively, you could remove those referer restrictions, but I don't think I would recommend that, especially if you're going to enable billing. (Wouldn't want someone stealing your queries or money!)

Jg

On Jul 13, 2012 11:44 AM, "Patrick Ziegler" <> wrote:

--
You received this message because you are subscribed to the Google
Groups "Google AJAX APIs" group.
To post to this group, send email to

To unsubscribe from this group, send email to
Reply all
Reply to author
Forward
0 new messages