I would like to grab the thumbnail urls of a list of restricted videos.
I created an app with vimeo and got an access token.
How do I use this access token to gain access to the method? When I try this:
videos = Vimeo::Advanced::Video.new("client_identifier", "client_secret",
:token => "access_token")
videos.get_thumbnail_urls(the_video_id)
I get
Vimeo::Advanced::RequestFailed: 401: Permission Denied, explanation: The oauth_token passed was either not valid or has expired.
My users don't have vimeo accounts so I don't see the point (or a way) have them authenticate with vimeo. I would like to grab the thumbnails of videos uploaded by the same account which created the app. My understanding is that the access token I generated ought to provide this access.
What am I missing?
Update: Here's what worked for me, based on the accepted answer
require 'httparty'
video_id = "123456789" # substitute with the desired video ID
api_url = "https://api.vimeo.com/videos/#{video_id}/"
auth = "Bearer access_token_generated_by_vimeo" # use your access token
r = HTTParty.get api_url, headers: { "Authorization" => auth, "Accept" => "application/vnd.vimeo.*+json;version=3.2" } # make sure to use the proper Accept header as recommended in the API docs
v = JSON.parse(r)
v["pictures"]["sizes"][1]["link"]