Brad Dougherty

Brad Dougherty Staff

Hi Sonal,

Looks like there is a Perl OAuth library available on the OAuth site: oauth.net/code/

Please note that we can't really help you with OAuth unless it is a specific problem with Vimeo's implementation or in regards to our API. There are lots of OAuth resources available on the internet that will do a better job than I can anyway.

sonal agrawal

sonal agrawal

Thanks for reply Brad, but still I am not able to get the videos.
here is my code:

my $key = XXXXXXXX ;
my $method = "vimeo.videos.search" ;
my $oauth_nonce = rand (9999999999999999 ) ;
my $timestamp = time ;
my $query = "nike" ;
my $secret = YYYYYYYY ;
my $url = "vimeo.com/api/rest/v2/"; ;

my $str ="method=$method&oauth_consumer_key=$key&oauth_nonce=$oauth_nonce&oauth_signature_method=HMAC-SHA1&oauth_timestamp=$timestamp&oauth_version=1.0&query=$query";
$str = uri_escape( $str) ;

$url = uri_escape( $url) ;
my $base_str = "GET"."&".$url."&".$str ;
my $secret_key = $secret."&" ;

my $hmac = Digest::HMAC_SHA1->new( $secret_key ) ;
$hmac->add($base_str) ;
$oauth_signature = $hmac->b64digest ;

which generates the signature as : Std2IYZywe1D/y6YXpBM6k3EZIY

after encoding signature is : Std2IYZywe1D%2Fy6YXpBM6k3EZIY

my call url is:"vimeo.com/api/rest/v2?format=xml&method=vimeo.videos.search&query=nike&oauth_consumer_key=XXXXXXXXXXX&oauth_nonce=&oauth_signature_method=HMAC-7.26231416761042e%2B15SHA1&oauth_timestamp=1335524065&oauth_version=1.0&oauth_signature=Std2IYZywe1D%2Fy6YXpBM6k3EZIY";

but I am getting the error says:
expl="The oauth_signature passed was not valid." msg="Invalid signature"

Please let me know where am I doing wrong.

I have also tried with oauth.net/code/
my $request = Net::OAuth->request('consumer')->new(
consumer_key => $key,
consumer_secret => $secret,
request_url => 'vimeo.com/api/rest/v2';,
request_method => 'GET',
signature_method => 'HMAC-SHA1',
timestamp => $timestamp,
nonce => $oauth_nonce,
);

my $oauth_signature =$request->sign ;

which gives the signature as: ZBFl7jXD4BFGTexcZ4Cj2edf3Zw=

after encoding signature is :ZBFl7jXD4BFGTexcZ4Cj2edf3Zw%3D

and my request url is :
vimeo.com/api/rest/v2?format=xml&method=vimeo.videos.search&query=nike&oauth_consumer_key=XXXXXXXX&oauth_nonce=7.26231416761042e%2B15&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1335524328&oauth_version=1.0&oauth_signature=ZBFl7jXD4BFGTexcZ4Cj2edf3Zw%3D

here also I am getting the same error msg saying : expl="The oauth_signature passed was not valid." msg="Invalid signature"

can you tell me what's wrong with my url below, I got same error

This conversation is missing your voice. Please join Vimeo or log in.