Hello everyone, in today post I shall be showing how to get the Vimeo videos of user using the api.
For various operations Vimeo provides methods, and it is this method that we pass as parameter to the api, for various features that we want to integrate.
Consider the URL below:
The above URL contains 3 parameters :
1.) format :- This specifies in which format we need the response, here we are using JSON.
2.) method :- This is the operation that we are performing, here since we want a list of all video we are using, vimeo.videos.getAll. For a complete list of method you can refer here.
3.) user_id :- This is the user for whom we want the video, I just picked a random user from site.
If you will call the above URL as it is, it will not work, since Vimeo uses OAuth to authenticate all the requests. For this we will have to generate an OAuth token.
- Register Your app at : https://developer.vimeo.com/apps/new
- Once done, go to Authentication tab and copy Client Identifier and Secret key.
- Download scribe library.
- Download Apache commons codec.
- Fetch token in your java code using, OAuthService Builder class.
- Sign the Request and get the response.
- Have a look at this class for the code.
- Download complete project to test.
Well I have simplified it as much as I can, thanks to the scribe class for making integration so easy.
If you liked my post please do share.