Skip to content

Latest commit

 

History

History
48 lines (37 loc) · 1.2 KB

README.md

File metadata and controls

48 lines (37 loc) · 1.2 KB

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