2014-09-17 2 views
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 Details

+1

API 키를 공개하지 마십시오. – hjpotter92

+0

마지막으로 해결책을 찾았습니다. "Referers 편집"을 클릭하고 입력 필드를 비우십시오. – Praveenks

답변

0

은 내가 어떤 블로거 '블로그와 연결하려는 안드로이드 응용 프로그램을 개발하고 물론 Blogger API v3에 대한 액세스가 필요했습니다. 나는 요청에 같은 오류가 있었다 : 나는 응용 프로그램에 대한 API 키 (안드로이드 키)를 만들었다

{ 
"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." 
} 
} 

을하고 내가 올바른 방법으로 일을하고 있다고 생각하지만, 오류가 날 때마다 내가 밀어 있음 다른 API 키 유형 (서버 키 또는 브라우저 키)을 생성하고 마법이 발생할 때까지 시도했습니다.

지금까지 논리를 이해하지 못했지만 공식적인 문서에는 그와 같은 것들을 기술 할 수 있다고 생각합니다.

관련 문제