Помогите понять в чем проблема, нужно организовать поиск с помощью Custom Search API, в консоли разработчика зарегистрировал приложение, дал разрешение и получил ключ (API Key), настроил поисковую систему и получил ключ поисковой системы. Приложении формирую GET запрос и в качестве параметров передаю
"https://www.googleapis.com/customsearch/v1?" +
"key=AIzaSyAsfVp2vbB2nOy90MXCW0iYZ-h1HYvUwwE" +
"&cx=009034774129468977321:wl08kmocg3m" +
"&q=summer" +
"&searchType=image"
В ответ получаю:
Код: Выделить всё
{
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "accessNotConfigured",
"message": "Access Not Configured. The API is not enabled for your project, or there is a per-IP or per-Referer restriction configured on your API key and the request does not match these restrictions. Please use the Google Developers Console to update your configuration.",
"extendedHelp": "https://console.developers.google.com"
}
],
"code": 403,
"message": "Access Not Configured. The API is not enabled for your project, or there is a per-IP or per-Referer restriction configured on your API key and the request does not match these restrictions. Please use the Google Developers Console to update your configuration."
}
}
Код: Выделить всё
HttpClient client = new DefaultHttpClient();
HttpGet request = new HttpGet("https://www.googleapis.com/customsearch/v1?" +
"key=AIzaSyAsfVp2vbB2nOy90MXCW0iYZ-h1HYvUwwE" +
"&cx=009034774129468977321:wl08kmocg3m" +
"&q=summer" +
"&searchType=image");
HttpResponse response = null;
try {
response = client.execute(request);
} catch (IOException e) {
e.printStackTrace();
}
if (response != null) {
try {
String result = EntityUtils.toString(response.getEntity(), "utf-8");
Log.d("Response", result);
} catch (IOException e) {
e.printStackTrace();
}
}
Может я чего-то где-то забыл указать?
Подскажите что я не так делаю и/ил где почитать?
Заранее огромнейшее СПАСИБО.