Search code examples
phpvimeovimeo-api

Vimeo API: how to save a vimeo into a subfolder?


Which api allow me as developer to move a video into a folder?

I, for example, have the video https://vimeo.com/12345678.

In my personal area, I created the folder "DEV" under "Video". Opening in the browser, it is linked as https://vimeo.com/manage/folders/20417534

I tried the following call

POST https://api.vimeo.com/me/albums/20417534/videos/12345678 

But I got an error complaining about album doesn't exist.

I supposed this is not the right API to call.

Which API must I call to specify in which folder to save the video?


Solution

  • You're using the /me/albums/ path, which is incorrect. You need to use the /projects/ path instead (Vimeo originally named the feature "projects" but later changed it to "folders". The API still uses the original naming convention).

    To add the video at /videos/12345678 to the folder at https://vimeo.com/manage/folders/20417534, make this request:

    PUT https://api.vimeo.com/me/projects/20417534/videos/12345678
    

    Alternatively, you could replace the /me/ path with /users/666666666/ if you want to use your userid, but /me/ is a nice shortcut, since this request can only really succeed with your own folder anyway.

    That endpoint is documented here: https://developer.vimeo.com/api/reference/projects#add_video_to_project