Integrate with Moovly

How to alllow your users to use Moovly and publish to your platform

Picture this: you have a platform with a lot of users that have everything they need. Except you want your users to be able to create videos and be able to use those on your platform. But you don't want to reinvent the wheel.

Here comes Moovly, we can help you integrate Moovly with your platform and allow your users to make videos and upload them to your platform without them even having to make a Moovly account.

  • Contact sales@moovly.com for an account with a group.
  • Basic OAuth 2 flow on your end.
  • Being able to handle a request from us containing the url to the video from the user.

2.1. OAuth 2

Get access to Moovly
  1. Send us your clientId and clientSecret to allow the OAuth 2 flow. You will need to support the following two redirect urls:
  2. Provide us with a url to generate a token.

We will send the following parameters as a GET request and we require you to redirect to the redirect url with the parameter code containing the generated code.

{
	"client_id" => //the clientId you generated,
    "redirect_uri" => //the redirect url you need to navigate to,
    "response_type" => 'code',
    "state" => //used to check if the request is correct
}
  1. Provide us with the endpoint to exchange the code for an access token. We will do a POST to this url with the following data as Content-type: application/x-www-form-urlencoded
{
	"grant_type" => 'authorization_code',
    "code" => //the code we received from the previous step,
    "client_id" => //your client id,
    "client_secret" => //your client secret,
    "redirect_uri" => //the redirect url you need to navigate to,
}

We require your response to be the following:

{
    "access_token": "0e028705e704c576671a5d28a123369c4e845291",
    "refresh_token": "wey3454fdgj6534regsrtdfgaesryw3aretga",
    "expires_in": 3600,
    "token_type": "Bearer",
    "scope": null
}
  1. This next step isn't part of the standard OAuth flow, but we need an endpoint to fetch your user's email and first name. We will execute a GET request with the access token to the endpoint and use it to create a Moovly account for your user. We require the following response from you:
{
	"email": //email of the user,
    "first_name": //first name of the user
}
  1. Last but not least we require a refresh endpoint to renew the tokens. This will also be a POST call with Content-type: application/x-www-form-urlencoded
{
	"grant_type" => 'refresh_token',
	"client_id" => //your client id,
	"client_secret" => //your client secret,
	"refresh_token" => //a refresh token,
}

Response:

{
    "access_token": "0e028705e704c576671a5d28a123369c4e845291",
    "refresh_token": "wey3454fdgj6534regsrtdfgaesryw3aretga",
    "expires_in": 3600,
    "token_type": "Bearer",
    "scope": null
}

Now to start your users on the journey to video making, just link them on your platform to this url: {your-platform}.sso.moovly.com. From there we will trigger the OAuth 2 flow.

If everything in the previous steps has been implemented correctly, they should be taken straight to Moovly and can start creating their own videos.

2.2. Publishing

Your (user's) videos published to you

Once your users created a video they can choose to publish it through Moovly to your platform.

To support this we need you to provide us with a url we can do a POST against with an access token and the following JSON as body.

{
	"render_url": "the url from where you can download the render, which will be valid for 3 days",
    "render_thumbnail": "url to the thumbnail of the render",
    "title": "title of the video"
}

2.3. Success

All done

Right now you have a working SSO and publish flow with Moovly. But the fun doesn't stop here. If you want you can make Moovly look like your platform. You can change the logo to yours and change the colours to represent your own brand and theme.

Get in contact with sales@moovly.com to further investigate these options.