Search code examples
pythonvimeovimeo-api

How to structure get 'review link' request from Vimeo API?


How to structure GET 'review link' request from Vimeo API?

New to python and assume others might benefit from my ignorance.

I'm simply trying to upload via the new vimeo api and return a 'review link'.

Are there current examples of the vimeo-api in python? I've read the documentation and can upload perfectly fine. However, when it comes to the http GET I can't seem to figure it out. Im using python2.7.5 and have tried requests library. Im ready to give up and just go back to PHP because its documented so much better.

Any python programmers out there familiar?


Solution

  • EDIT: Since this was written the vimeo.py library was rebuilt. This is now as simple as taking the API URI and requesting vc.get('/videos/105113459') and looking for the review link in the response.

    The original:

    If you know the API URL you want to retrieve this for, you can convert it into a vimeo.py call by replacing the slashes with dots. The issue with this is that in Python attributes (things separated by the dots), are syntax errors.

    With our original rule, if you wanted to see /videos/105113459 in the python library you would do vc.videos.105113459() (if you had vc = vimeo.VimeoClient(<your token and app data>)).

    To resolve this you can instead use python's getattr() built-in function to retrieve this. In the end you use getattr(vc.videos, '105113459')() and it will return the result of GET /videos/105113459.

    I know it's a bit complicated, but rest assured there are improvements that we're working on to eliminate this common workaround.