3.3.1 • Published 6 years ago

tba-api-v3client v3.3.1

Weekly downloads
2
License
Unlicense
Repository
-
Last release
6 years ago

tba-api-v3client

TbaApiV3client - JavaScript client for tba-api-v3client

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 SDK is automatically generated by the Swagger Codegen project:

  • API version: 3.03.1
  • Package version: 3.03.1
  • Build package: io.swagger.codegen.languages.JavascriptClientCodegen

Installation

For Node.js

npm

To publish the library as a npm, please follow the procedure in "Publishing npm packages".

Then install it via:

npm install tba-api-v3client --save
Local development

To use the library locally without publishing to a remote npm registry, first install the dependencies by changing into the directory containing package.json (and this README). Let's call this JAVASCRIPT_CLIENT_DIR. Then run:

npm install

Next, link it globally in npm with the following, also from JAVASCRIPT_CLIENT_DIR:

npm link

Finally, switch to the directory you want to use your tba-api-v3client from, and run:

npm link /path/to/<JAVASCRIPT_CLIENT_DIR>

You should now be able to require('tba-api-v3client') in javascript files from the directory you ran the last command above from.

git

If the library is hosted at a git repository, e.g. https://github.com/GIT_USER_ID/GIT_REPO_ID then install it via:

    npm install GIT_USER_ID/GIT_REPO_ID --save

For browser

The library also works in the browser environment via npm and browserify. After following the above steps with Node.js and installing browserify with npm install -g browserify, perform the following (assuming main.js is your entry file, that's to say your javascript file where you actually use this library):

browserify main.js > bundle.js

Then include bundle.js in the HTML pages.

Webpack Configuration

Using Webpack you may encounter the following error: "Module not found: Error: Cannot resolve module", most certainly you should disable AMD loader. Add/merge the following section to your webpack config:

module: {
  rules: [
    {
      parser: {
        amd: false
      }
    }
  ]
}

Getting Started

Please follow the installation instruction and execute the following JS code:

var TbaApiV3client = require('tba-api-v3client');

var defaultClient = TbaApiV3client.ApiClient.instance;

// Configure API key authorization: apiKey
var apiKey = defaultClient.authentications['apiKey'];
apiKey.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.apiKeyPrefix['X-TBA-Auth-Key'] = "Token"

var api = new TbaApiV3client.DistrictApi()

var districtKey = "districtKey_example"; // {String} TBA District Key, eg `2016fim`

var opts = { 
  'ifModifiedSince': "ifModifiedSince_example" // {String} Value of the `Last-Modified` header in the most recently cached response by the client.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getDistrictEvents(districtKey, opts, callback);

Documentation for API Endpoints

All URIs are relative to https://www.thebluealliance.com/api/v3

ClassMethodHTTP requestDescription
TbaApiV3client.DistrictApigetDistrictEventsGET /district/{district_key}/events
TbaApiV3client.DistrictApigetDistrictEventsKeysGET /district/{district_key}/events/keys
TbaApiV3client.DistrictApigetDistrictEventsSimpleGET /district/{district_key}/events/simple
TbaApiV3client.DistrictApigetDistrictRankingsGET /district/{district_key}/rankings
TbaApiV3client.DistrictApigetDistrictTeamsGET /district/{district_key}/teams
TbaApiV3client.DistrictApigetDistrictTeamsKeysGET /district/{district_key}/teams/keys
TbaApiV3client.DistrictApigetDistrictTeamsSimpleGET /district/{district_key}/teams/simple
TbaApiV3client.DistrictApigetDistrictsByYearGET /districts/{year}
TbaApiV3client.DistrictApigetEventDistrictPointsGET /event/{event_key}/district_points
TbaApiV3client.DistrictApigetTeamDistrictsGET /team/{team_key}/districts
TbaApiV3client.EventApigetDistrictEventsGET /district/{district_key}/events
TbaApiV3client.EventApigetDistrictEventsKeysGET /district/{district_key}/events/keys
TbaApiV3client.EventApigetDistrictEventsSimpleGET /district/{district_key}/events/simple
TbaApiV3client.EventApigetEventGET /event/{event_key}
TbaApiV3client.EventApigetEventAlliancesGET /event/{event_key}/alliances
TbaApiV3client.EventApigetEventAwardsGET /event/{event_key}/awards
TbaApiV3client.EventApigetEventDistrictPointsGET /event/{event_key}/district_points
TbaApiV3client.EventApigetEventInsightsGET /event/{event_key}/insights
TbaApiV3client.EventApigetEventMatchTimeseriesGET /event/{event_key}/matches/timeseries
TbaApiV3client.EventApigetEventMatchesGET /event/{event_key}/matches
TbaApiV3client.EventApigetEventMatchesKeysGET /event/{event_key}/matches/keys
TbaApiV3client.EventApigetEventMatchesSimpleGET /event/{event_key}/matches/simple
TbaApiV3client.EventApigetEventOPRsGET /event/{event_key}/oprs
TbaApiV3client.EventApigetEventPredictionsGET /event/{event_key}/predictions
TbaApiV3client.EventApigetEventRankingsGET /event/{event_key}/rankings
TbaApiV3client.EventApigetEventSimpleGET /event/{event_key}/simple
TbaApiV3client.EventApigetEventTeamsGET /event/{event_key}/teams
TbaApiV3client.EventApigetEventTeamsKeysGET /event/{event_key}/teams/keys
TbaApiV3client.EventApigetEventTeamsSimpleGET /event/{event_key}/teams/simple
TbaApiV3client.EventApigetEventTeamsStatusesGET /event/{event_key}/teams/statuses
TbaApiV3client.EventApigetEventsByYearGET /events/{year}
TbaApiV3client.EventApigetEventsByYearKeysGET /events/{year}/keys
TbaApiV3client.EventApigetEventsByYearSimpleGET /events/{year}/simple
TbaApiV3client.EventApigetTeamEventAwardsGET /team/{team_key}/event/{event_key}/awards
TbaApiV3client.EventApigetTeamEventMatchesGET /team/{team_key}/event/{event_key}/matches
TbaApiV3client.EventApigetTeamEventMatchesKeysGET /team/{team_key}/event/{event_key}/matches/keys
TbaApiV3client.EventApigetTeamEventMatchesSimpleGET /team/{team_key}/event/{event_key}/matches/simple
TbaApiV3client.EventApigetTeamEventStatusGET /team/{team_key}/event/{event_key}/status
TbaApiV3client.EventApigetTeamEventsGET /team/{team_key}/events
TbaApiV3client.EventApigetTeamEventsByYearGET /team/{team_key}/events/{year}
TbaApiV3client.EventApigetTeamEventsByYearKeysGET /team/{team_key}/events/{year}/keys
TbaApiV3client.EventApigetTeamEventsByYearSimpleGET /team/{team_key}/events/{year}/simple
TbaApiV3client.EventApigetTeamEventsKeysGET /team/{team_key}/events/keys
TbaApiV3client.EventApigetTeamEventsSimpleGET /team/{team_key}/events/simple
TbaApiV3client.EventApigetTeamEventsStatusesByYearGET /team/{team_key}/events/{year}/statuses
TbaApiV3client.ListApigetDistrictEventsGET /district/{district_key}/events
TbaApiV3client.ListApigetDistrictEventsKeysGET /district/{district_key}/events/keys
TbaApiV3client.ListApigetDistrictEventsSimpleGET /district/{district_key}/events/simple
TbaApiV3client.ListApigetDistrictRankingsGET /district/{district_key}/rankings
TbaApiV3client.ListApigetDistrictTeamsGET /district/{district_key}/teams
TbaApiV3client.ListApigetDistrictTeamsKeysGET /district/{district_key}/teams/keys
TbaApiV3client.ListApigetDistrictTeamsSimpleGET /district/{district_key}/teams/simple
TbaApiV3client.ListApigetEventTeamsGET /event/{event_key}/teams
TbaApiV3client.ListApigetEventTeamsKeysGET /event/{event_key}/teams/keys
TbaApiV3client.ListApigetEventTeamsSimpleGET /event/{event_key}/teams/simple
TbaApiV3client.ListApigetEventTeamsStatusesGET /event/{event_key}/teams/statuses
TbaApiV3client.ListApigetEventsByYearGET /events/{year}
TbaApiV3client.ListApigetEventsByYearKeysGET /events/{year}/keys
TbaApiV3client.ListApigetEventsByYearSimpleGET /events/{year}/simple
TbaApiV3client.ListApigetTeamEventsStatusesByYearGET /team/{team_key}/events/{year}/statuses
TbaApiV3client.ListApigetTeamsGET /teams/{page_num}
TbaApiV3client.ListApigetTeamsByYearGET /teams/{year}/{page_num}
TbaApiV3client.ListApigetTeamsByYearKeysGET /teams/{year}/{page_num}/keys
TbaApiV3client.ListApigetTeamsByYearSimpleGET /teams/{year}/{page_num}/simple
TbaApiV3client.ListApigetTeamsKeysGET /teams/{page_num}/keys
TbaApiV3client.ListApigetTeamsSimpleGET /teams/{page_num}/simple
TbaApiV3client.MatchApigetEventMatchTimeseriesGET /event/{event_key}/matches/timeseries
TbaApiV3client.MatchApigetEventMatchesGET /event/{event_key}/matches
TbaApiV3client.MatchApigetEventMatchesKeysGET /event/{event_key}/matches/keys
TbaApiV3client.MatchApigetEventMatchesSimpleGET /event/{event_key}/matches/simple
TbaApiV3client.MatchApigetMatchGET /match/{match_key}
TbaApiV3client.MatchApigetMatchSimpleGET /match/{match_key}/simple
TbaApiV3client.MatchApigetMatchTimeseriesGET /match/{match_key}/timeseries
TbaApiV3client.MatchApigetTeamEventMatchesGET /team/{team_key}/event/{event_key}/matches
TbaApiV3client.MatchApigetTeamEventMatchesKeysGET /team/{team_key}/event/{event_key}/matches/keys
TbaApiV3client.MatchApigetTeamEventMatchesSimpleGET /team/{team_key}/event/{event_key}/matches/simple
TbaApiV3client.MatchApigetTeamMatchesByYearGET /team/{team_key}/matches/{year}
TbaApiV3client.MatchApigetTeamMatchesByYearKeysGET /team/{team_key}/matches/{year}/keys
TbaApiV3client.MatchApigetTeamMatchesByYearSimpleGET /team/{team_key}/matches/{year}/simple
TbaApiV3client.TBAApigetStatusGET /status
TbaApiV3client.TeamApigetDistrictRankingsGET /district/{district_key}/rankings
TbaApiV3client.TeamApigetDistrictTeamsGET /district/{district_key}/teams
TbaApiV3client.TeamApigetDistrictTeamsKeysGET /district/{district_key}/teams/keys
TbaApiV3client.TeamApigetDistrictTeamsSimpleGET /district/{district_key}/teams/simple
TbaApiV3client.TeamApigetEventTeamsGET /event/{event_key}/teams
TbaApiV3client.TeamApigetEventTeamsKeysGET /event/{event_key}/teams/keys
TbaApiV3client.TeamApigetEventTeamsSimpleGET /event/{event_key}/teams/simple
TbaApiV3client.TeamApigetEventTeamsStatusesGET /event/{event_key}/teams/statuses
TbaApiV3client.TeamApigetTeamGET /team/{team_key}
TbaApiV3client.TeamApigetTeamAwardsGET /team/{team_key}/awards
TbaApiV3client.TeamApigetTeamAwardsByYearGET /team/{team_key}/awards/{year}
TbaApiV3client.TeamApigetTeamDistrictsGET /team/{team_key}/districts
TbaApiV3client.TeamApigetTeamEventAwardsGET /team/{team_key}/event/{event_key}/awards
TbaApiV3client.TeamApigetTeamEventMatchesGET /team/{team_key}/event/{event_key}/matches
TbaApiV3client.TeamApigetTeamEventMatchesKeysGET /team/{team_key}/event/{event_key}/matches/keys
TbaApiV3client.TeamApigetTeamEventMatchesSimpleGET /team/{team_key}/event/{event_key}/matches/simple
TbaApiV3client.TeamApigetTeamEventStatusGET /team/{team_key}/event/{event_key}/status
TbaApiV3client.TeamApigetTeamEventsGET /team/{team_key}/events
TbaApiV3client.TeamApigetTeamEventsByYearGET /team/{team_key}/events/{year}
TbaApiV3client.TeamApigetTeamEventsByYearKeysGET /team/{team_key}/events/{year}/keys
TbaApiV3client.TeamApigetTeamEventsByYearSimpleGET /team/{team_key}/events/{year}/simple
TbaApiV3client.TeamApigetTeamEventsKeysGET /team/{team_key}/events/keys
TbaApiV3client.TeamApigetTeamEventsSimpleGET /team/{team_key}/events/simple
TbaApiV3client.TeamApigetTeamEventsStatusesByYearGET /team/{team_key}/events/{year}/statuses
TbaApiV3client.TeamApigetTeamMatchesByYearGET /team/{team_key}/matches/{year}
TbaApiV3client.TeamApigetTeamMatchesByYearKeysGET /team/{team_key}/matches/{year}/keys
TbaApiV3client.TeamApigetTeamMatchesByYearSimpleGET /team/{team_key}/matches/{year}/simple
TbaApiV3client.TeamApigetTeamMediaByTagGET /team/{team_key}/media/tag/{media_tag}
TbaApiV3client.TeamApigetTeamMediaByTagYearGET /team/{team_key}/media/tag/{media_tag}/{year}
TbaApiV3client.TeamApigetTeamMediaByYearGET /team/{team_key}/media/{year}
TbaApiV3client.TeamApigetTeamRobotsGET /team/{team_key}/robots
TbaApiV3client.TeamApigetTeamSimpleGET /team/{team_key}/simple
TbaApiV3client.TeamApigetTeamSocialMediaGET /team/{team_key}/social_media
TbaApiV3client.TeamApigetTeamYearsParticipatedGET /team/{team_key}/years_participated
TbaApiV3client.TeamApigetTeamsGET /teams/{page_num}
TbaApiV3client.TeamApigetTeamsByYearGET /teams/{year}/{page_num}
TbaApiV3client.TeamApigetTeamsByYearKeysGET /teams/{year}/{page_num}/keys
TbaApiV3client.TeamApigetTeamsByYearSimpleGET /teams/{year}/{page_num}/simple
TbaApiV3client.TeamApigetTeamsKeysGET /teams/{page_num}/keys
TbaApiV3client.TeamApigetTeamsSimpleGET /teams/{page_num}/simple

Documentation for Models

Documentation for Authorization

apiKey

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