statscore/apiclient 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

statscore/apiclient

Composer 安装命令:

composer require statscore/apiclient

包简介

STATSCORE Official SportsAPI Client

关键字:

README 文档

README

Build Status Packagist codecov PHP from Travis config Quality Gate Status Libraries.io dependency status for GitHub repo

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

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

统计信息

  • 总下载量: 29
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 0
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0-or-later
  • 更新时间: 2019-10-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固