tba-api / tba-api-client-php
# Overview Information and statistics about FIRST Robotics Competition teams and events. # Authentication All endpoints require an Auth Key to be passed in the header `X-TBA-Auth-Key`. If you do not have an auth key yet, you can obtain one from your [Account Page](/account). A `User-Agent`
Requires
- php: >=7.1
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^6.2
Requires (Dev)
- friendsofphp/php-cs-fixer: ~2.12
- phpunit/phpunit: ^7.4
- squizlabs/php_codesniffer: ~2.6
This package is auto-updated.
Last update: 2024-12-05 04:10:05 UTC
README
Overview
Information and statistics about FIRST Robotics Competition teams and events.
Authentication
All endpoints require an Auth Key to be passed in the header X-TBA-Auth-Key
. If you do not have an auth key yet, you can obtain one from your Account Page.
A User-Agent
header may need to be set to prevent a 403 Unauthorized error.
This PHP package is automatically generated by the OpenAPI Generator project:
- API version: 3.8.0
- Build package: org.openapitools.codegen.languages.PhpClientCodegen
Requirements
PHP 7.3 and later
Installation & Usage
Composer
To install the bindings via Composer, add the following to composer.json
:
{ "repositories": [ { "type": "vcs", "url": "https://github.com/tba-api/tba-api-client-php.git" } ], "require": { "tba-api/tba-api-client-php": "*@dev" } }
Then run composer install
Manual Installation
Download the files and include autoload.php
:
require_once('/path/to/TBA-API-v3client/vendor/autoload.php');
Tests
To run the unit tests:
composer install ./vendor/bin/phpunit
Getting Started
Please follow the installation procedure and then run the following:
<?php require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: apiKey $config = TBAAPI\v3client\Configuration::getDefaultConfiguration()->setApiKey('X-TBA-Auth-Key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // $config = TBAAPI\v3client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-TBA-Auth-Key', 'Bearer'); $apiInstance = new TBAAPI\v3client\Api\DistrictApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client(), $config ); $district_key = 'district_key_example'; // string | TBA District Key, eg `2016fim` $if_modified_since = 'if_modified_since_example'; // string | Value of the `Last-Modified` header in the most recently cached response by the client. try { $result = $apiInstance->getDistrictEvents($district_key, $if_modified_since); print_r($result); } catch (Exception $e) { echo 'Exception when calling DistrictApi->getDistrictEvents: ', $e->getMessage(), PHP_EOL; } ?>
Documentation for API Endpoints
All URIs are relative to https://www.thebluealliance.com/api/v3
Documentation For Models
- APIStatus
- APIStatusAppVersion
- Award
- AwardRecipient
- DistrictList
- DistrictRanking
- DistrictRankingEventPoints
- EliminationAlliance
- EliminationAllianceBackup
- EliminationAllianceStatus
- Event
- EventDistrictPoints
- EventDistrictPointsPoints
- EventDistrictPointsTiebreakers
- EventInsights
- EventInsights2016
- EventInsights2017
- EventInsights2018
- EventOPRs
- EventRanking
- EventRankingExtraStatsInfo
- EventRankingRankings
- EventRankingSortOrderInfo
- EventSimple
- Match
- MatchAlliance
- MatchScoreBreakdown2015
- MatchScoreBreakdown2015Alliance
- MatchScoreBreakdown2016
- MatchScoreBreakdown2016Alliance
- MatchScoreBreakdown2017
- MatchScoreBreakdown2017Alliance
- MatchScoreBreakdown2018
- MatchScoreBreakdown2018Alliance
- MatchScoreBreakdown2019
- MatchScoreBreakdown2019Alliance
- MatchScoreBreakdown2020
- MatchScoreBreakdown2020Alliance
- MatchSimple
- MatchSimpleAlliances
- MatchTimeseries2018
- MatchVideos
- Media
- Team
- TeamEventStatus
- TeamEventStatusAlliance
- TeamEventStatusAllianceBackup
- TeamEventStatusPlayoff
- TeamEventStatusRank
- TeamEventStatusRankRanking
- TeamEventStatusRankSortOrderInfo
- TeamRobot
- TeamSimple
- WLTRecord
- Webcast
- Zebra
- ZebraAlliances
- ZebraTeam
Documentation For Authorization
apiKey
- Type: API key
- API key parameter name: X-TBA-Auth-Key
- Location: HTTP header