2017 © Pedro Peláez
 

library oahu

Oahu PHP Client

image

oahu/oahu

Oahu PHP Client

  • Friday, March 14, 2014
  • by oahu
  • Repository
  • 6 Watchers
  • 0 Stars
  • 401 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

Oahu PHP client

Installation

If you are using composer, just add oahu/oahu this to your composer.json file :, (*1)

{
  "name" : "my/awesome-oahu-app",
  "version" : "0.1.0",
  "require" : {
    "oahu/oahu": "dev-master"
  }
}

Usage

Configuration

<?php 
set_include_path(dirname(__FILE__) . ":");
require('vendor/autoload.php');

$config = array(
  'oahu' => array(
    "host"      => "api.example.com",
    "clientId"  => 'OAHU_CLIENT_ID',
    "appId"     => 'OAHU_APP_ID',
    "appSecret" => 'OAHU_APP_SECRET')
  )
);

$oahu = new Oahu_Client($config);

Using caching (with memcached)

API (GET) responses will be cached in Memcached if caching is enabled., (*2)

<?php 
set_include_path(dirname(__FILE__) . ":");
require('vendor/autoload.php');

$config = array(
  'oahu' => array(
    "host"      => "api.example.com",
    "clientId"  => 'OAHU_CLIENT_ID',
    "appId"     => 'OAHU_APP_ID',
    "appSecret" => 'OAHU_APP_SECRET'),
    "cache"     => "true",
    "cacheHost" => "127.0.0.1",
    "cachePort" => 11211,
    "cacheExpiration" => 120 // in seconds
  )
);

$oahu = new Oahu_Client($config);

Making API Calls

get, put, post methods are directly available on your instance of Oahu_Client., (*3)

Examples using the API directly

Getting the list of Projects
<?php
$oahu->get('projects');
<?php
// where ':project_id' is a valid project_id
$oahu->get('projects/:project_id/apps');
<?php
// where ':project_id' is a valid project_id
$oahu->get('projects/:project_id/pub_accounts');
Using pagination
<?php 
$oahu->get('projects', array('limit' => 10, 'page' => 2))

Getting the infos on a User Account by its id

$accountInfos   = $oahu->getAccount($accountId);

Getting the current User Account if connected via Oahu connect

$accountInfos = $oahu->getCurrentAccount();

APIs

Method Helpers

Projects API
listProjects($params=array())

Returns a list of Projects for the current Client, (*4)

getProject($projectId)

Returns a Project's infos, (*5)

createProject($projectType, $projectData)

Creates a new Project, (*6)

updateProject($projectId, $projectData)

Update a Project's infos, (*7)

updateProjectPoster($projectId, $imageId)

Set the Project's Poster (default image), (*8)

updateProjectTrailer($projectId, $videoId)

Sets the Project's Trailer (default video), (*9)

getProjectResources($projectId, $params)

Get all Projects resources (Image, Video, ImageList, VideoList), (*10)

getProjectPhotos($projectId, $params)

Get all Project's Image resources, (*11)

getProjectVideos($projectId, $params)

Get all Project's Video resources, (*12)

listProjectPubAccounts($projectId)

Get all Project's PubAccounts (Facebook pages, Twitter accounts), (*13)

Resources API
createProjectResource($projectId, $resourceType, $resourceData)

Create a new Resource (Image, Video, ImageList, VideoList), (*14)

updateProjectResource($projectId, $resourceId, $resourceData)

Update a single Resource, (*15)

createProjectImageList($projectId, $resourceData)

Helper to create an ImageList, (*16)

createProjectVideoList($projectId, $resourceData)

Helper to create an VideoList, (*17)

Apps API

The Versions

14/03 2014

dev-master

9999999-dev http://github.com/sixdegrees/oahu-php-client

Oahu PHP Client

  Sources   Download

MIT

by Oahu Dev Team

01/10 2013

v0.2.1

0.2.1.0 http://github.com/sixdegrees/oahu-php-client

Oahu PHP Client

  Sources   Download

MIT

The Requires

 

by Oahu Dev Team

19/02 2013

dev-develop

dev-develop http://github.com/sixdegrees/oahu-php-client

Oahu PHP Client

  Sources   Download

MIT

The Requires

 

by Oahu Dev Team

20/11 2012

v0.2.0

0.2.0.0 http://github.com/sixdegrees/oahu-php-client

Oahu PHP Client

  Sources   Download

MIT

The Requires

 

by Oahu Dev Team

04/07 2012

0.1.1

0.1.1.0 http://github.com/sixdegrees/oahu-php-client

Oahu PHP Client

  Sources   Download

MIT

by Oahu Dev Team