keyteqlabs/keymedia

Keymedia API wrapper in PHP

v1.3.1 2016-09-27 16:53 UTC

This package is not auto-updated.

Last update: 2024-11-05 01:42:08 UTC


README

KeyMedia PHP API wrapper

Build Status Latest Stable Version

Basic usage example

composer require keyteqlabs/keymedia

Initialize the client

$client = new Keyteq\Keymedia\KeymediaClient('username', 'keymediaURL', 'apiKey');
//In case you don't have the API key yet
$client = new Keyteq\Keymedia\KeymediaClient('username', 'keymediaURL');
$client->getToken('password');

Working with albums

$albums = $client->listAlbums();

// List album content
$mediaArray = $client->getAlbum('albumName');

// Search within album
$mediaArray = $client->getAlbum('albumName', 'searchTerm');

Search by media / album names

$mediaArray = $client->findMedia('searchTerm');

Get a single media object by ID

$media = $client->getMedia('id');

Accessing media information

$type = $media->getType();
$isImage = $media->isImage();
$url = $media->getUrl();
$thumbnailUrl = $media->getThumbnailUrl($width, $height);