Can anyone give a help in Vimeo API using scribe? My goal is to access a private video (which I uploaded) without having to force the user to put password (this process should be done in background).
From what I understand / deduce from research is necessary:
Request for application authorization using oAuth protocol and via the following link:
https://vimeo.com/oauth/authorize?oauth_token=XXXX
This operation is performed successfully and response data are sent to callback URL, something like:
http://127.0.0.1:8001/XPTO.html?oauth_token=AUTH_TOKEN_EXAMPLE&oauth_verifier=VERIFIIER__EXAMPLE"
According to Brad Dougherty (Vimeo API Staff) it´s possible do something like that
If you go through the OAuth process as yourself, you can save that token and use that to make the calls.
I'm using this code:
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();
I've the following error:
Response body is incorrect. Can't extract token and secret from this: '401 Unauthorized - Invalid signature - The oauth_signature passed was not valid.'
What's escaping me? This is the correct way to do it, right?