GithubHelp home page GithubHelp logo

php-v2-sdk's Introduction

Ooyala's V2 API PHP SDK

The PHP SDK is a client class for our V2 API.

2017-05-18 - TAG created "v2.0"

Requirements

This SDK uses cURL. So, in order to get it running, you need to have the libcurl package installed.

If PHP is manually compiled, don't forget to add the --with-curl[=DIR] configuration option. Or in Linux environments to make sure a php5-curl or similar package is installed. In a Windows environment, libeay32.dll and ssleay32.dll must be present in the PATH environment variable.

Usage

The approach is very simple. It allows you to do GET, POST, PUT, PATCH and DELETE requests to our API by simply specifying the path to the API you want to hit and depending of the call, an Array with parameters and an Array containing the body of the request.

By specifying an associative array object to represent the JSON data you want to send, you can make calls very fast and easily. First you need to create an OoyalaApi object by passing your V2 API keys like this:

<?php
    $api = new OoyalaApi("<api key>", "<secret key>");

Now lets get all the assets under the "Funny dogs" label:

<?php
    $parameters = array("where" => "labels INCLUDES 'Funny dogs'");

    $results = $api->get("assets", $parameters);
    $assets = $results->items;

Now that we have our results on the assets ArrayList, lets print them out to the console.

<?php
    echo "Printing assets in the 'Funny dogs' label...";
    foreach($assets as $asset) {
        echo $asset->embed_code . " - " . $asset->name . "\n";
    }

It's that easy to work with this SDK!

License

See LICENSE file.

php-v2-sdk's People

Contributors

alanoooyala avatar hskrtich avatar pepegasca avatar simensen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

php-v2-sdk's Issues

Composer package

I see the composer.json file, but this package is not available on composer. Is this something that is coming?

No version tags

Can you create a version tag (i.e. 2.0 or something)? At the moment the only way to install via Composer is to lower the minimum stability requirement because there are no published versions.

Non-UTF-8 encoded title, description, etc causes json_decode to fail

Our team did a csv import of apparently non-UTF-8 encoded data into backlot. The bad text seems to be passed through the assets endpoint.

What I'm seeing is that OoyalaApi::sendRequest() attempts to json_decode() the data before returning. PHP's json_decode() requires UTF-8 encoding to work. As sendRequest() does not check if the data could actually decoded, null is returned to the calling function.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.