質問

I'm trying to search for videos on VIMEO using their advanced API, in order to get some basic info about them such as their video ID and Thumbnail URL.

This is my code, which I pretty much copied from HERE:

public void getResponse() {

    String consumerString = "consumer_key_from_vimeo_app";
    String consumerSecret = "consumer_secret_from_vimeo_app";

    OAuthService service = new ServiceBuilder()
            .provider(VimeoApi.class)
            .apiKey(consumerString)
            .apiSecret(consumerSecret)
            .build();

    OAuthRequest  myrequest = new OAuthRequest(Verb.GET,
            "http://vimeo.com/api/rest/?format=json&method=vimeo.videos.search&page=1&per_page=3&summary_response=1&query=shakira");
    Token mytoken = new Token("", "");
    service.signRequest(mytoken, myrequest);
    Response response = myrequest.send();

    System.out.println(response.getBody());
}

I expect it to print a JSON. However, this prints the code for a "Not found" HTML page. Any ideas as to what I'm doing wrong?

役に立ちましたか?

解決

The proper Vimeo Advanced API url is "http://vimeo.com/api/rest/v2?method=METHOD". It looks like you are missing the v2. You can read more here : https://developer.vimeo.com/apis/advanced#endpoint

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top