2017 © Pedro Peláez
 

library visupedia

Official Visupedia API library client for PHP

image

visupedia/visupedia

Official Visupedia API library client for PHP

  • Wednesday, October 1, 2014
  • by Visupedia
  • Repository
  • 2 Watchers
  • 0 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

visupedia-api-php

Official Visupedia API library client for PHP, (*1)

This library is generated by alpaca, (*2)

Installation

Make sure you have composer installed., (*3)

Add the following to your composer.json, (*4)

{
    "require": {
        "visupedia/visupedia": "@dev"
    }
}

Update your dependencies, (*5)

$ php composer.phar update

This package follows the PSR-0 convention names for its classes, which means you can easily integrate these classes loading in your own autoloader., (*6)

Versions

Works with [ 5.4 / 5.5 ], (*7)

Usage

<?php

// This file is generated by Composer
require_once 'vendor/autoload.php';

// Then we instantiate a client (as shown below)

Build a client

Without any authentication
$client = new Visupedia\Client();

// If you need to send options
$client = new Visupedia\Client(array(), $clientOptions);

Client Options

The following options are available while instantiating a client:, (*8)

  • base: Base url for the api
  • api_version: Default version of the api (to be used in url)
  • user_agent: Default user-agent for all requests
  • headers: Default headers for all requests
  • request_type: Default format of the request body

Response information

All the callbacks provided to an api call will recieve the response as shown below, (*9)

$response = $client->klass('args')->method('args', $methodOptions);

$response->code;
// >>> 200

$response->headers;
// >>> array('x-server' => 'apache')

Method Options

The following options are available while calling a method of an api:, (*10)

  • api_version: Version of the api (to be used in url)
  • headers: Headers for the request
  • query: Query parameters for the url
  • body: Body of the request
  • request_type: Format of the request body

Request body information

Set request_type in options to modify the body accordingly, (*11)

RAW request

When the value is set to raw, don't modify the body at all., (*12)

$body = 'username=pksunkara';
// >>> 'username=pksunkara'

Visu api

Returns an MyVisu api instance, (*13)

The following arguments are required:, (*14)

  • key: The api key provided by Visupedia
$visu = $client->visu("53214f86e2ae54.93050075");
Query a Visu (GET /api?key=:key&id=:id&lang=:lang&version=:version)

Returns all information about the wanted Visu, (*15)

The following arguments are required:, (*16)

  • id: The unique ID of the Visu
  • lang: The language code wanted for the Visu
  • version: Use a specific version of our API
$response = $visu->get("5396d8c752cfd8.93460735", "fr", "2", $options);

Contributors

Here is a list of Contributors, (*17)

TODO

License

MIT, (*18)

Bug Reports

Report here., (*19)

Contact

Gaël Gillard (dev@visupedia.net), (*20)

The Versions

01/10 2014

dev-master

9999999-dev http://visupedia.net

Official Visupedia API library client for PHP

  Sources   Download

MIT

The Requires

 

visupedia