statscore/apiclient
Composer 安装命令:
composer require statscore/apiclient
包简介
STATSCORE Official SportsAPI Client
关键字:
README 文档
README
The API service is based on the REST architecture and supports a number of resources accessed with HTTP protocol. The client should send a HTTP GET request and in return will receive a return list document in JSON or XML format. The default response format is JSON.
Table of Contents
Installation
Prerequisites
- PHP version >=7.2
- ext-json required
Documentation
Hot to install package
Use Composer to install the latest version with command:
$ composer require statscore/apiclient
or add our package to your composer.json file.
{
"require": {
"statscore/apiclient": "^1"
}
}
Examples
Authentication
Access to the API is based on the oAuth 2.0 authorization method. This means access is given using a unique token without any IP's restriction.
The client is authenticated using a GET request including query string parameters: client_id and secret_key. These parameters are assigned to you by our sales department. On confirmation of the client_id/secret_key combination, the special oAuth token is then returned. Maximum period of time the token is valid is 24 hours from the time it was generated. This token should be sent with all subsequent requests.
<?php use Statscore\Client; use Statscore\Model\Response\Authorization\AuthorizationDTO; $clientId = 1; $statscore = new Client($clientId, 'yoursecretkey'); /** @var AuthorizationDTO $authDTO */ $authDTO = $statscore->authorize(); /** Get your token, save it and use in future requests */ $statscore->setToken($authDTO->getToken());
Booked Events
Get all
<?php use Statscore\Model\Response\BookedEvent\BookedEventDTO; use Statscore\Model\Response\ResponseDTO; $clientId = 1; $productName = 'livescorepro'; /** @var ResponseDTO $response */ $response = $statscore->bookedEvents->getAll($clientId, $productName); /** @var BookedEventDTO[] $bookedEvents */ $bookedEvents = $response->getData();
Create
<?php use Statscore\Model\Response\BookedEvent\BookedEventDTO; use Statscore\Model\Response\ResponseDTO; $clientId = 1; $productName = 'livescorepro'; $eventId = 1232131; /** @var ResponseDTO $response */ $response = $statscore->bookedEvents->create($clientId, $productName, $eventId); /** @var BookedEventDTO[] $bookedEvents */ $bookedEvents = $response->getData();
Delete
<?php use Statscore\Model\Response\ResponseDTO; $clientId = 1; $productName = 'livescorepro'; $eventId = 1232131; /** @var ResponseDTO $response */ $response = $statscore->bookedEvents->delete($clientId, $productName, $eventId);
Troubleshooting
Our support team, based in Katowice, exists for one purpose: to serve and delight STATSCORE customers.
Have a question? Our team will help you find answers 24 hours a day, 365 days a year. Please send us an email at tech-support@statscore.com
Issues are tracked on GitHub
statscore/apiclient 适用场景与选型建议
statscore/apiclient 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 29 次下载、GitHub Stars 达 2, 最近一次更新时间为 2019 年 10 月 04 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「statscore」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 statscore/apiclient 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 statscore/apiclient 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 statscore/apiclient 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
统计信息
- 总下载量: 29
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0-or-later
- 更新时间: 2019-10-04