Download the PHP package clowdy/vimeo-api without Composer

On this page you can find all versions of the php package clowdy/vimeo-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package vimeo-api

This is a fork of the official PHP library for the Vimeo API modified to work with @composer.


vimeo.php

Vimeo.php is a library for interacting with the latest version of the Vimeo API.

Installation

To install vimeo.php, you can download the latest version from https://github.com/vimeo/vimeo.php.

To utilize the library in your code, you should include vimeo.php.

Usage

Making an API Request

In the Vimeo API, all requests must be authenticated in some method. For applications that only require access to public information, we offer oAuth2's client credentials grant. For applications that require users to authenticate, oAuth2's authorization code grant.

An example of this usage is:

Application Only Access Token

To get an application only token, you should run the following code (commented for clarity).

This response will contain the token you can add into this handle with $vimeo->setToken($token_from_response). The token should be stored for later use, and you can save time in future runs by using it and skipping the request step.

User authenticated Access Tokens

Getting a user to authenticate with your application is a bit more complicated. Your application will have to redirect the user to Vimeo where they log in and verify that they will grant your application the requested scopes. The basic required steps are:

  1. Initialize the Vimeo API handle, $vimeo = new Vimeo(YOUR_APPLICATION_ID, YOUR_APPLICATION_SECRET);
  2. Send the user to the authorization page on Vimeo. The link is given by $vimeo->buildAuthorizationEndpoint($redirect_uri, $scopes); (Note: if your application only requires public information, you can omit the scopes argument).
  3. The user authenticates and authorizes your app on the Vimeo site and is redirected back to the location provided in $redirect_uri. (Note: This URI must be registered with Vimeo on the developer site).
  4. When the user is returned we will have a querystring parameter code.
  5. Now that we have the code, we need to exchange it for an access token. We repeat step 1 to get ourselves a handle for the Vimeo API.
  6. The code can be exchanged by calling $vimeo->accessToken($code, $redirect_uri);

An example of this can be seen in examples/auth.php.

Uploading a file

Uploading a file can occur in one of two ways:

  1. Streaming the file to the Vimeo servers
  2. POSTing the file from a client web browser

The library provides a sample tool for method #1 in examples/upload.php.

If you want to integrate the upload functionality with an existing PHP application, you should follow these steps:

  1. Initialize a Vimeo class to interact with the server with the proper credentials. *
  2. With the path to your file, call $vimeo->upload($file_path).
  3. The response from that function will contain a Location header with the URI to the newly created resource. You can call that to set metadata such as the title or check on the transcode status.

* Note: Vimeo requires applications that perform uploads to request and be granted special permissions. This can be done on the Vimeo developer site.

If you are developing a web application and would like to have the users upload directly to Vimeo's servers instead of relaying through yours, you can utilize the POST method. The simplest implementation of this is as follows:

  1. Configure your redirect target with your app on the Vimeo developer site.
  2. Make sure that your callback is functional, it will receive the data when Vimeo has finalized the upload.
  3. Initialize a Vimeo class to interact with the server with the proper credentials (requires the same special permission as the streaming API).
  4. Call $vimeo->request('/me/videos', array('type' => 'POST', 'redirect_url' => $redirect_target), 'POST')
  5. The response body should contain a field called form, this can be accessed via $response['body']->form. The contents of that should be printed into your page and sent to the end user. Once they submit the form it will send the video to Vimeo's servers and we will complete the flow before sending them back to the provided redirect_url.
  6. When the user comes back to the redirect_url, you will have an additional query param (to any you may have included) called video_uri. This can be used to load and edit the newly created clip via the standard API methods.

Troubleshooting

  1. todo explain "curl not found" error
  2. If your api request returns with an empty array, it likely means you do not have the proper https certificates. You can find more information on how to solve the problem here : http://unitstep.net/blog/2009/05/05/using-curl-in-php-to-access-https-ssltls-protected-sites/

Contributors


All versions of vimeo-api with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package clowdy/vimeo-api contains the following files

Loading the files please wait ....