2017-09-20 1 views
0

저는 다양한 서비스의 REST API로 작업하는 데있어 아주 새롭습니다.
YouTube에서 동영상을 검색하려고합니다.YouTube에 간단한 REST GET 요청 API 반환 오류

GCP에서 Youtube Data API를 사용 설정하고 키를 생성하고 Referrer Restriction을 설정합니다. 우체부에서 (또는 브라우저에서 - 같은 결과) 나는 URL에 GET 메소드를 호출 (API 탐색기에서 가져온)

https://content.googleapis.com/youtube/v3/search?part=snippet&q=angular&key=MY_API_KEY 

헤더에 올바른 값으로 참조 자 필드를 추가합니다.

{ 
    "error": { 
     "errors": [ 
      { 
       "domain": "usageLimits", 
       "reason": "ipRefererBlocked", 
       "message": "The referrer ReferreValue does not match the referrer restrictions configured on your API key. Please use the API Console to update your key restrictions.", 
       "extendedHelp": "https://console.developers.google.com/apis/credentials?project=589726014278" 
      } 
     ], 
     "code": 403, 
     "message": "The referrer ReferreValue does not match the referrer restrictions configured on your API key. Please use the API Console to update your key restrictions." 
    } 
} 

문제 :

는 서비스에서 해답
1. 내 프로젝트 ID가 589,726,014,278 아니다;
2. 리퍼러 값은 물론 알 수없는 프로젝트 ID에 맞지 않습니다.

질문 : 어떻게 작동합니까? 가능한 한 간단하게 유지하고 싶습니다. OAuth가 없으면 아무거나. 가능한가?

답변