Vimeo API AuthorizationUrl Without Login

≡放荡痞女 提交于 2019-12-06 10:02:52

问题


I'm using Vimeo API to get video on a web application context and i have a simple question (i hope :P )

It´s possible to do a request for application authorization using oAuth protocol and via the following link: https://vimeo.com/oauth/authorize?oauth_token=XXXX, WITHOUT force the user to login in browser?

I noticed that if I'm not logged on Vimeo, when I go to https://vimeo.com/oauth/authorize?oauth_token=XXXX, Vimeo redirects me to the login page...

Thanks.


回答1:


I found it =)

You can create the access token using the application credentials or using the login data. In this case you don't have to make a authorize call.

Example (taken from comments):

String vimeoAPIURL = "vimeo.com/api/rest/v2?video_id=213";
OAuthRequest request = new OAuthRequest(Verb.GET, vimeoAPIURL);

request.addQuerystringParameter("format", "json");
request.addQuerystringParameter("method","vimeo.videos.getUploaded";
request.addQuerystringParameter("user_id", "user137");
request.addQuerystringParameter("full_response", "true");
request.addQuerystringParameter("method","vimeo.videos.getThumbnailUrls");

service.signRequest(accessToken, request);
Response response = request.send();

Syso(response.getCode());
Syso(response.getBody());


来源:https://stackoverflow.com/questions/12672181/vimeo-api-authorizationurl-without-login

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!