'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 1:[1]

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

Solution 2:[2]

You don't have to upload then move the video. You can specify the parameter folder_uri and just send in the uri of the folder. The video will appear there immediately.

var parameters = new Dictionary<string, string>
{
    ["upload.approach"] = "pull",
    ["upload.link"] = link,
    ["privacy.embed"] = "private",
    ["privacy.download"] = "false",
    ["privacy.comments"] = "nobody",
    ["privacy.view"] = "unlisted",
    ["name"] = title,
    ["description"] = description
};
    
if (parentFolderId != null) {
    parameters.Add("folder_uri", parentFolderId);
}

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Tommy Penner
Solution 2 CarComp