API YouTube - не удалось выполнить поиск: com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 запрещено
Я следовал этому руководству по созданию приложения Youtube. Я создал ключ API браузера-Android и попробовал оба из них в своем проекте. Но когда я пытаюсь запустить его и выполнить поиск, я получаю:
Could not search: com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 Forbidden
{
"code" : 403,
"errors" : [ {
"domain" : "usageLimits",
"message" : "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 API key configuration if request from this IP or referer should be allowed.",
"reason" : "ipRefererBlocked",
"extendedHelp" : "https://console.developers.google.com"
} ],
"message" : "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 API key configuration if request from this IP or referer should be allowed."
}
Любая идея..?
3 ответа
Решение
Проблема устранена путем установки рефери браузера api для любого рефери.
Все, что вам нужно сделать, это: Удалить / Редактировать Referers на "Любой рефери разрешен" из раздела "Ключ для приложений браузера" .
Установить "Любой разрешенный реферером" просто, как стереть все входы, разрешенные реферером.