Vimeo 객체 생성 예시
형식 : $client = new Vimeo("{client_id}", "{client_secret}", "{access_token}");
//설정 예시 $client = new Vimeo("123", "abc", "a1b");
앱 등록
앱 등록하고
토큰
받아야 API 사용 가능.- My Apps 페이지로 이동
- Create an app 버튼 클릭.
- App Name & App Description 입력
- end user가 앱을 다운로드하거나 관련정보를 얻을 수 있는 URL 표기
- Vimeo API 라이센스 등 동의 체크
- Create App 클릭

Vimeo SDK 설정
(개발환경 설정) Vimeo API와 연결하고 상호작용하려면 개발환경 셋팅 필요
다양한 환경 지원
https://developer.vimeo.com/api/libraries (전체 지원 환경 목록)
- 그중에서 우리는
vimeo.js
쓰면 됨. vimeo.js GitHub
Node.js 기준 설치
$ npm install vimeo
엑세스 토큰 생성
Vimeo AuthenticationVimeo API 호출 예시
HTTP 직접 요청도 가능
We've also included the HTTP code in cURL and as HTTP if you'd rather map the HTTP commands to your own request library instead of using our SDKs. You don't need your client ID or client secret for this sort of operation, but you do need to supply your access token. It belongs in the Authorization header, after the keyword bearer and a space,
like this:
bearer {access_token}.
⇒ SDK 안쓰고 HTTP 요청을 직접 날려도 됨. 헤더에
`bearer ${access_token}`
만 셋팅하면 됨.SDK 사용 예시
Node.js 기준
//require let Vimeo = require('vimeo').Vimeo; //Vimeo 객체 생성 let client = new Vimeo("{client_id}", "{client_secret}", "{access_token}"); //Vimeo 객체를 통한 http 요청 송수신 client.request({ method: 'GET', path: '/tutorial' }, function (error, body, status_code, headers) { if (error) { console.log(error); } console.log(body); })
에러핸들링
client ID
,client secret
,access token
설정 잘 했는지 확인
- 실패 response를 잘 읽어봐라
user_message
: 그냥 일반적인 에러사항 출력 (기술적인 부분 X)developer_message
: 디버깅을 위한 더 많은 정보 포함 (기술적인 부분 O)
- 엑세스 토큰 재발급