Skip to content
This repository has been archived by the owner on Dec 9, 2022. It is now read-only.

Latest commit

 

History

History
60 lines (41 loc) · 1.7 KB

README.md

File metadata and controls

60 lines (41 loc) · 1.7 KB

XMAVEN SDK for PHP

@XmavenVideo on Twitter

This library has been created for PHP developers using the Xmaven platform. It provides a very lightweight wrapper to communicate with Xmaven API. Getting started could not be easier, find our package on packagist: https://packagist.org/packages/venatus/xmaven-php-sdk

Install by adding { .. "venatus/xmaven-php-sdk": "0.1" .. } to your composer.json file.

The wrapper creates a Guzzle request object. This can be used to further extends the library where required. More information about Guzzle can be found here: http://guzzle.readthedocs.org/en/latest/

Installing via Composer

The recommended way to install Guzzle is through Composer.

# Install Composer
curl -sS https://getcomposer.org/installer | php

Next, run the Composer command to install the latest stable version of Guzzle:

composer.phar require venatus/xmaven-php-sdk

After installing, you need to require Composer's autoloader:

require 'vendor/autoload.php';

PHP Examples

<?php
require 'vendor/autoload.php';

//Create instance of the API Wrapper
$xm = new Xmaven\API($userId, $privateKey);

//Get all media items
$res = $xm->makeRequest('GET','/v1/media');

//Get all media items, limit to just 5 returned.
$res = $xm->makeRequest('GET','/v1/media', array(
  'limit' => 5,
));

//Create a new media item
$res = $xm->makeRequest('POST','/v1/media',array(),array(
  'title' => 'test',
));
var_dump($res);

Documentation

More information can be found in the online documentation at https://docs.xmaven.com/api/01-installation