-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CSE key .. where the heck is it? #38
Comments
Did you see the rest of the instructions?
|
server credential? Implying under credentials -> service key? In what format should the key be. The answer is - Under credentials, select "API Key" which will then give you a selection of different API key types, and there you select the "server" option. |
@vaivars I am not even seeing the credentials section that you are talking about. Grrrrr. This is frustrating. |
I think the layout here has changed on Google's side. I also am unable to get this working. Several different API key types result in HTTP 401. |
So... 5 months later nobody had a clue? I'm still stuck with this and I think I already exhausted every possibility. If someone figure this one out, please take us all to the light! |
Sorry, no clue. It seems like it has changed twice during this time :(. |
The parent repo has been marked as DEPRECATED: https://github.com/hubot-scripts/packages If you're looking for help, here's probably not your best bet. :( For now, your best bet is to use the Bing Image search script. |
The deprecation notice on packages does not apply to this repo. This is still the official home of the hubot-google-images. The issue of setting up a custom search engine should be solvable by looking at Google's own documentation. Today you can get there by looking for "API Manager" in the hamburger menu on Google Cloud Platform Console. From API Manager enable the custom search API and then you should be able to get to a key from there. |
Thanks Harold! Here is a direct link - you must create the project first though. |
Hey everybody, I got it working three days ago, and maybe it was the lack
of good documentation on google part and the ambiguous instructions on the
readme for hubot-google-images or both.
Never the less, I would like to share to future reference for others with
this kind of problem trying to put it in a more straightforward way.
When you follow the instructions on the readme, it is pretty easy to setup
a custom search, make sure it works and that when you search is loading any
result, tweakit as much as you want, but you can tweak it later anyway, but
if you're not getting results here is going to be harder to know if there
is something wrong when you try to get your hubot to fetch some images.
There, you get on the basic settings for the custom search your ID string.
This Id string is what you need for your CSE_ID. save it and keep it where
you can reachit when you need it.
Now on the developer console for google, if you didn't do it before, you
have to set up your project, and enable the api. You can enable other apis
too if you want. But enable the api and you will have now the option to
create the api key.
The problem i had here is that I misunderstood that i needed the ID for
something, I tried to use the CSE_ID to create some key... some server key
or something and I always ended in the same loop, creating some service key
for that and it didn work at all, and I was even generating some encrypted
key and I wouldn't know what to do with it.
Just forget it. You only needed the CSE_ID for hubot script, and nothing
else. Now you just create some API on the console that grants access to the
Custom Search Engine API. No matter what, they give you a string, and there
it is. Your CSE_KEY.
But to be able to use it, and that was another road blocker for me, you
need to restrict the key so you can really use it. I don't know why, but it
is just how it is. If you use domain restriction is not going to work,
Apparently, -and I'm just guessing here- the request from hubot is direct
and it doesn't use any domain at all... so that's where the "SERVER KEY"
comes to play. there are different restrictions, Android, website (domain),
or server... that last one request for an IP address. You just look the
Public IP address from where hubot is accessing the web and grant access
for this IP only, and now your key will begin to work,
So, this API key string... is what it gets you to hubot fetching images.
So you got your CSE_ID from custom search engine configurator. Any time you
enter the configurator from the account you created it from, you will se
the option to edit it. You Get the CSE_KEY from the developer console under
a project, after enabling the CSE API for that project. But you need to
restrict IP to be able to use it.
If you end up having problems like error 400 o error 403 or something like
that check:
1. that your custom search engine is giving any image result.
2. that your api has CSE API enabled. You can check how the API is working
going to library(In the developer console) and selecting the CSE API and
there you click the "try this api in the api manager" button or somthing
like that. After that you will see that there are a lot of fields to use
the api to search. You only need CX with the CSE_ID and q with the query.
If the page gives you a result in json with urls with response 200...
everithing is ok, if you get a really small json with 400 or 403, check
that your CSE engine is working or that you have the right CSE_ID.
I hope I'm putting some light on the matter for someone with similar
problems as me.
Thanks a lot
…____________________
*Alejandro Angel*
On Fri, Mar 10, 2017 at 3:32 PM, vaivars ***@***.***> wrote:
Thanks Harold! Here is a direct link
<https://console.cloud.google.com/apis/api/customsearch.googleapis.com/>
- you must create the project first though.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<https://github.com/hubot-scripts/hubot-google-images/issues/38#issuecomment-285777040>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AC-o1yg7EF6hDsBc4mLppVYGTKdvxN20ks5rkbN1gaJpZM4HyoCo>
.
|
"Get the CSE KEY here https://code.google.com/apis/console"
quite vague -- I see like 5 different keys here, and none are called CSE or custom search engine key.
I need to make a new project?
The text was updated successfully, but these errors were encountered: