Vimeo Video Upload With Codeignite
Upload Vimeo video with CodeIgniter, Official PHP library for the Vimeo API. Vimeo Video upload with API using Official PHP library for the Vimeo API.
Vimeo Video Upload With Codeigniter
This is a simple PHP library for interacting with the Vimeo API.
#Get Started
- Help
- Troubleshooting
- Installation
- Usage
- Authentication and access tokens
- Unauthenticated tokens
- Authenticated tokens
- Make requests
- Uploading videos
- Upload videos from a server
- Replace videos from a server
- Client side uploads
- Upload videos from a URL
- Upload images
- Framework integrations
- Get started with the Vimeo API
Installation
1 .Require this package, with Composer, in the root directory of your project.
Please note that this library requires at least PHP 7.1 installed. If you are on PHP 5.6, or PHP 7.0, please use install the package with the following:
composer require vimeo/vimeo-api
2 .Use the library $lib = new \Vimeo\Vimeo($client_id, $client_secret)
#Unauthenticated Unauthenticated API requests must generate an access token. You should not generate a new access token for each request. Instead, request an access token once and use it forever.
scope
is an array of permissions your token needs to access.
https://developer.vimeo.com/api/authentication#supported-scopes
You can read more at$token = $lib->clientCredentials(scope);
#usable access token var_dump($token['body']['access_token']);
accepted scopes
var_dump($token['body']['scope']);
use the token
$lib->setToken($token['body']['access_token']);
#Authenticated
- Build a link to Vimeo so your users can authorize your app.
- Your user needs to access the authorization endpoint (either by clicking the link or through a redirect). On the authorization endpoint, the user will have the option to deny your app any scopes you have requested. If they deny your app, they are redirected back to your redirect_url with an error parameter.
- If the user accepts your app, they are redirected back to your redirect_uri with a code and state query parameter (eg. http://yourredirect.com?code=abc&state=xyz). I. You must validate that the state matches your state from Step 1. II . If the state is valid, you can exchange your code and redirect_uri for an access token.
redirect_uri
must be provided, and must match your configured URI
$token = $lib->accessToken(code, redirect_uri);
Usable access token
var_dump($token['body']['access_token']);
Accepted scopes
var_dump($token['body']['scope']);
Set the token
$lib->setToken($token['body']['access_token']);