forward-force / tms-api-sdk
PHP Wrapper around TMS API
Installs: 28 572
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 2
Open Issues: 1
Requires
- php: ^8.1
- ext-json: *
- guzzlehttp/guzzle: ^7.0.1
- nesbot/carbon: ^2.57
Requires (Dev)
- phpmd/phpmd: ^2.9
- phpunit/phpunit: ^9.5
- squizlabs/php_codesniffer: ^3.5
- vimeo/psalm: ^4.5
README
Installation
Install via composer as follows:
composer require forward-force/tms-api-sdk
Usage
Authentication
In order to authenticate, you need to pass the PRIVATE API TOKEN like so:
$tms = new TMS($token);
Examples
Get Lineups by zip code and country (country is optional):
$lineups = $tms->lineups()->fetchByZipcode('USA','78701');
Fetch all channels for a lineup:
try { $channels = $tms->lineups()->fetchChannels('USA-DTVNOW-DEFAULT'); var_dump($channels); } catch (GuzzleException $e) { var_dump($e->getMessage()); }
Retrieve an image for an asset:
try{ $params = [ 'w' => 100, 'h' => 100, 'trim' => 'true', ]; $media = $tms->lineups()->fetchAssetFromMedia($token, 's51307_ll_h3_aa.png',$params); var_dump($media); } catch (GuzzleException $e) { var_dump($e->getMessage()); }
Retrieve airings by station id:
try { $airingsByStation = $tms->lineups()->getStationAirings('10142', date("c", strtotime('-2 days'))); var_dump($airingsByStation); } catch (GuzzleException $e) { var_dump($e->getMessage()); }
Retrieve programs by tms id:
try { $programsByTmsId = $tms->lineups()->getPrograms('EP001151270163');; var_dump($programsByTmsId); } catch (GuzzleException $e) { var_dump($e->getMessage()); }
Contributions
To run locally, you can use the docker container provided here. You can run it like so:
docker-compose up
There is auto-generated documentation as to how to run this library on local, please take a look at phpdocker/README.md
If you find an issue, have a question, or a suggestion, please don't hesitate to open a github issue.
Acknowledgments
Thank you to phpdocker.io for making getting PHP environments effortless!