abstra-docs
Search…
⌃K

Upload videos to Vimeo using Storage Connector

In this tutorial you will learn how to create a page that a user can upload a video to your Vimeo account.

Vimeo Setup

First we you need to register and application within Vimeo. This can be accomplished by following Vimeo's own guide.
Then you need to generate an access_token. This can be accomplished by following Vimeo's own guide. Make sure to give this token the upload scope. After you get the token, store it some safe place.

Connector setup

Once you have all the information above you can now create a REST connector. In this tutorial we will be using the pull approach to upload to Vimeo's API. Create a connector called Vimeo API and add https://api.vimeo.com as its base url. For headers add the following:
  • Authorization: bearer <access_token>
  • Content-Type: application/json
  • Accept: application/vnd.vimeo.*+json;version=3.4

Method Setup

Create a method called Submit. The HTTP Method should be POST and the URL Path should be /me/videos.

Storage connector

In this tutorial the video submitted will first uploaded to an AWS S3 Bucket and then uploaded to Vimeo. For this make sure you have a fully configured Storage connector with an upload method as well.

Frontend Setup

In the frontend you will call the connectors you previously setup.
Add a button and an action on click. This first action should be the Storage method of upload file you previously created.
On the success of this action add another connetor call to the Vimeo connector to submit the video. The request body should be the following:
{
"upload": {
"approach": "pull",
"link": "{{{ response.url }}}"
}
}
Create a global variable called vimeoLink and set the result of the API call in it: $.response.link
This vimeoLink variable stores the final link of the uploaded video. So if you want you can save on your database with hosted tables or send an email to notify someone. In this tutorial you will simply redirect to it with an External Link action.

Testing your application

That's it. Now we just test the application.
Note that the video may not be available right away but in a few moments (depending on the video size) it will be live: