forward-force/tms-api-sdk
Composer 安装命令:
composer require forward-force/tms-api-sdk
包简介
PHP Wrapper around TMS API
关键字:
README 文档
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!
统计信息
- 总下载量: 55.85k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-09-21