Skip to content

KeyteqLabs/keymedia-php

Repository files navigation

keymedia-php

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);