任何人都可以在使用抄寫員的Vimeo API中提供幫助嗎?我的目標是訪問一個私人視頻(我上傳),而不必強制用戶輸入密碼(此過程應在後臺完成)。使用OAuth令牌查看Vimeo私人視頻
從我的理解/從研究推斷是必要的:使用OAuth協議,並通過以下鏈接
請求應用程序授權:
https://vimeo.com/oauth/authorize?oauth_token=XXXX
成功執行此操作響應數據被髮送到回撥URL, 類似:
http://127.0.0.1:8001/XPTO.html?oauth_token=AUTH_TOKEN_EXAMPLE&oauth_verifier=VERIFIIER__EXAMPLE"
According to Brad Dougherty(Vimeo的API職員)it's可能做這樣的事情
If you go through the OAuth process as yourself, you can save that token and use that to make the calls.
我使用這個代碼:
service = new ServiceBuilder().provider(VimeoApi.class)
.apiKey("API_KEY_EXAMPLE")
.apiSecret("API_SECRET_EXAMPLE")
.build();
OAuthRequest request = new OAuthRequest(Verb.GET,
"http://vimeo.com/api/rest/v2?video_id=50305416");
request.addQuerystringParameter("format", "json");
request.addQuerystringParameter("method", "vimeo.videos.getInfo");
String oauth_verifier=VERIFIER__EXAMPLE;
Verifier verifier = new Verifier(oauth_verifier);
//I've tried differents combination to create this token
//I believe that my problem is HERE
//One unsuccessfully try: Token requestToken = service.getRequestToken();
Token requestToken = new Token(
AUTH_TOKEN_EXAMPLE,
API_SECRET_EXAMPLE);
Token token = service.getAccessToken(requestToken, verifier);
service.signRequest(token, request);
Response response = request.send();
我下面錯誤:
Response body is incorrect. Can't extract token and secret from this: '401 Unauthorized - Invalid signature - The oauth_signature passed was not valid.'
什麼在逃避我?這是正確的方法,對吧?
你不能自己創建RequestToken。你*必須*使用'service.getRequestToken()' –
好的帕布羅,現在我可以移動請求=)你能幫我解決問題的第二部分嗎?我不希望用戶輸入密碼(它是一個用於多個用戶的Web應用程序)...以獲取用戶必須使用的身份驗證令牌(https://vimeo.com/oauth/authorize?oauth_token=XXXX)登錄:(我怎麼能避免這個?因爲我不能使用簡單的Vimeo API檢索私人視頻(像http://vimeo.com/api/rest/v2?video_id=50305416)...如何(我沒有類似的方法=()Tks。 – JMarques
我已經解決了我的第一個問題(http://stackoverflow.com/questions/12672181/vimeo-api-authorizationurl-without-login )=)把我與天堂隔開的唯一步驟就是......我到底是怎麼得到一個私人視頻? – JMarques