Giter Site home page Giter Site logo

gady-ox-wal / 23video-for-php Goto Github PK

View Code? Open in Web Editor NEW

This project forked from 23/23video-for-php

0.0 0.0 0.0 100 KB

A sample class for performing requests to the API of a TwentyThree account from PHP. NOTE: NOT ACTIVELY SUPPORTED.

PHP 100.00%

23video-for-php's Introduction

23 Video for PHP

A simple PHP library for communicating with your 23 Video site using the 23 Video API.

Requirements and prerequisites

The library is written for recent versions of PHP 5 and requires the curl PHP extension to be installed to function properly. Furthermore, you are required to manually obtain all the credentials necessary for the 23 Video site you're communicating with.

Usage

The library contains a single source code file, visualvideo.php, which contains the class VisualVideo. The first step to communicating with your 23 Video site is to set up an instance of this class:

<?php
    require_once('visualvideo.php');
    
    $client = new VisualVideo('http://mydomain.23video.com', 
                              $consumerKey, 
                              $consumerSecret,
                              $accessToken, 
                              $accessTokenSecret);
?>

Please note that you must supply the address to your 23 Video site with the protocol specified and with no trailing slash.

To perform a GET request to an endpoint, like /api/photo/list, you can now simply use the client instance as follows:

<?php
    $response = $client->get('/api/photo/list', 
                             array('include_hidden_p' => '1',
                                   'album_id' => '1234', 
                                   'token' => 'SRPECA3OC5OAIM37OD26GIY6UV1HAXE'));
?>

Performing a POST request happens in the exact same way, although only URL encoded POST requests are supported by this library, which means that file uploads must be implemented manually:

<?php
    $response = $client->post('/api/photo/list', 
                              array('include_hidden_p' => '1',
                                    'album_id' => '1234', 
                                    'token' => 'SRPECA3OC5OAIM37OD26GIY6UV1HAXE'));
?>

23video-for-php's People

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.