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`

v3.8.0 2020-03-10 02:37 UTC

This package is auto-updated.

Last update: 2024-09-05 03:34:41 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

Documentation For Authorization

apiKey

  • Type: API key
  • API key parameter name: X-TBA-Auth-Key
  • Location: HTTP header

Author