0
jQuery와 JSON을 사용하여 블로그 세부 정보를 가져 오려고합니다. 또한 블로그에 액세스 할 수있는 API 키 (브라우저 응용 프로그램 용)를 설정했지만 API 키가 제대로 작동하지 않습니다. 올바르게 구성하는 방법을 제안하십시오.블로거 API를 호출하는 동안 액세스가 구성되지 않았습니다.
코드 :
<!Doctype html>
<html>
<head>
<title>My Page</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
</head>
<body>
<script>
var url = 'https://www.googleapis.com/blogger/v2/blogs/',
apikey = '/posts?key=API_KEY',
blogId = '4011997376355783864';
$.ajax({
url: url +blogId+apikey,
dataType: "jsonp",
success : function(data){
console.log(data);
},
error :function(request, error){
alert('error');
}
});
</script>
</body>
</html>
오류 :
error: Objectcode: 403
errors: Array[1]
message: "Access Not Configured. Please use Google Developers Console to activate the API for your project."
키 세부 정보 :
API 키를 공개하지 마십시오. – hjpotter92
마지막으로 해결책을 찾았습니다. "Referers 편집"을 클릭하고 입력 필드를 비우십시오. – Praveenks