Skip to content

Latest commit

 

History

History
568 lines (384 loc) · 16.7 KB

DistrictApi.md

File metadata and controls

568 lines (384 loc) · 16.7 KB

TbaApiV3client.DistrictApi

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

Method HTTP request Description
getDistrictEvents GET /district/{district_key}/events
getDistrictEventsKeys GET /district/{district_key}/events/keys
getDistrictEventsSimple GET /district/{district_key}/events/simple
getDistrictRankings GET /district/{district_key}/rankings
getDistrictTeams GET /district/{district_key}/teams
getDistrictTeamsKeys GET /district/{district_key}/teams/keys
getDistrictTeamsSimple GET /district/{district_key}/teams/simple
getDistrictsByYear GET /districts/{year}
getEventDistrictPoints GET /event/{event_key}/district_points
getTeamDistricts GET /team/{team_key}/districts

getDistrictEvents

[Event] getDistrictEvents(districtKey, opts)

Gets a list of events in the given district.

Example

import TbaApiV3client from 'tba-api-v3client';
let defaultClient = TbaApiV3client.ApiClient.instance;
// Configure API key authorization: apiKey
let 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 = 'Token';

let apiInstance = new TbaApiV3client.DistrictApi();
let districtKey = "districtKey_example"; // String | TBA District Key, eg `2016fim`
let opts = {
  'ifModifiedSince': "ifModifiedSince_example" // String | Value of the `Last-Modified` header in the most recently cached response by the client.
};
apiInstance.getDistrictEvents(districtKey, opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
districtKey String TBA District Key, eg `2016fim`
ifModifiedSince String Value of the `Last-Modified` header in the most recently cached response by the client. [optional]

Return type

[Event]

Authorization

apiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getDistrictEventsKeys

[String] getDistrictEventsKeys(districtKey, opts)

Gets a list of event keys for events in the given district.

Example

import TbaApiV3client from 'tba-api-v3client';
let defaultClient = TbaApiV3client.ApiClient.instance;
// Configure API key authorization: apiKey
let 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 = 'Token';

let apiInstance = new TbaApiV3client.DistrictApi();
let districtKey = "districtKey_example"; // String | TBA District Key, eg `2016fim`
let opts = {
  'ifModifiedSince': "ifModifiedSince_example" // String | Value of the `Last-Modified` header in the most recently cached response by the client.
};
apiInstance.getDistrictEventsKeys(districtKey, opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
districtKey String TBA District Key, eg `2016fim`
ifModifiedSince String Value of the `Last-Modified` header in the most recently cached response by the client. [optional]

Return type

[String]

Authorization

apiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getDistrictEventsSimple

[EventSimple] getDistrictEventsSimple(districtKey, opts)

Gets a short-form list of events in the given district.

Example

import TbaApiV3client from 'tba-api-v3client';
let defaultClient = TbaApiV3client.ApiClient.instance;
// Configure API key authorization: apiKey
let 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 = 'Token';

let apiInstance = new TbaApiV3client.DistrictApi();
let districtKey = "districtKey_example"; // String | TBA District Key, eg `2016fim`
let opts = {
  'ifModifiedSince': "ifModifiedSince_example" // String | Value of the `Last-Modified` header in the most recently cached response by the client.
};
apiInstance.getDistrictEventsSimple(districtKey, opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
districtKey String TBA District Key, eg `2016fim`
ifModifiedSince String Value of the `Last-Modified` header in the most recently cached response by the client. [optional]

Return type

[EventSimple]

Authorization

apiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getDistrictRankings

[DistrictRanking] getDistrictRankings(districtKey, opts)

Gets a list of team district rankings for the given district.

Example

import TbaApiV3client from 'tba-api-v3client';
let defaultClient = TbaApiV3client.ApiClient.instance;
// Configure API key authorization: apiKey
let 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 = 'Token';

let apiInstance = new TbaApiV3client.DistrictApi();
let districtKey = "districtKey_example"; // String | TBA District Key, eg `2016fim`
let opts = {
  'ifModifiedSince': "ifModifiedSince_example" // String | Value of the `Last-Modified` header in the most recently cached response by the client.
};
apiInstance.getDistrictRankings(districtKey, opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
districtKey String TBA District Key, eg `2016fim`
ifModifiedSince String Value of the `Last-Modified` header in the most recently cached response by the client. [optional]

Return type

[DistrictRanking]

Authorization

apiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getDistrictTeams

[Team] getDistrictTeams(districtKey, opts)

Gets a list of `Team` objects that competed in events in the given district.

Example

import TbaApiV3client from 'tba-api-v3client';
let defaultClient = TbaApiV3client.ApiClient.instance;
// Configure API key authorization: apiKey
let 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 = 'Token';

let apiInstance = new TbaApiV3client.DistrictApi();
let districtKey = "districtKey_example"; // String | TBA District Key, eg `2016fim`
let opts = {
  'ifModifiedSince': "ifModifiedSince_example" // String | Value of the `Last-Modified` header in the most recently cached response by the client.
};
apiInstance.getDistrictTeams(districtKey, opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
districtKey String TBA District Key, eg `2016fim`
ifModifiedSince String Value of the `Last-Modified` header in the most recently cached response by the client. [optional]

Return type

[Team]

Authorization

apiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getDistrictTeamsKeys

[String] getDistrictTeamsKeys(districtKey, opts)

Gets a list of `Team` objects that competed in events in the given district.

Example

import TbaApiV3client from 'tba-api-v3client';
let defaultClient = TbaApiV3client.ApiClient.instance;
// Configure API key authorization: apiKey
let 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 = 'Token';

let apiInstance = new TbaApiV3client.DistrictApi();
let districtKey = "districtKey_example"; // String | TBA District Key, eg `2016fim`
let opts = {
  'ifModifiedSince': "ifModifiedSince_example" // String | Value of the `Last-Modified` header in the most recently cached response by the client.
};
apiInstance.getDistrictTeamsKeys(districtKey, opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
districtKey String TBA District Key, eg `2016fim`
ifModifiedSince String Value of the `Last-Modified` header in the most recently cached response by the client. [optional]

Return type

[String]

Authorization

apiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getDistrictTeamsSimple

[TeamSimple] getDistrictTeamsSimple(districtKey, opts)

Gets a short-form list of `Team` objects that competed in events in the given district.

Example

import TbaApiV3client from 'tba-api-v3client';
let defaultClient = TbaApiV3client.ApiClient.instance;
// Configure API key authorization: apiKey
let 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 = 'Token';

let apiInstance = new TbaApiV3client.DistrictApi();
let districtKey = "districtKey_example"; // String | TBA District Key, eg `2016fim`
let opts = {
  'ifModifiedSince': "ifModifiedSince_example" // String | Value of the `Last-Modified` header in the most recently cached response by the client.
};
apiInstance.getDistrictTeamsSimple(districtKey, opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
districtKey String TBA District Key, eg `2016fim`
ifModifiedSince String Value of the `Last-Modified` header in the most recently cached response by the client. [optional]

Return type

[TeamSimple]

Authorization

apiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getDistrictsByYear

[DistrictList] getDistrictsByYear(year, opts)

Gets a list of districts and their corresponding district key, for the given year.

Example

import TbaApiV3client from 'tba-api-v3client';
let defaultClient = TbaApiV3client.ApiClient.instance;
// Configure API key authorization: apiKey
let 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 = 'Token';

let apiInstance = new TbaApiV3client.DistrictApi();
let year = 56; // Number | Competition Year (or Season). Must be 4 digits.
let opts = {
  'ifModifiedSince': "ifModifiedSince_example" // String | Value of the `Last-Modified` header in the most recently cached response by the client.
};
apiInstance.getDistrictsByYear(year, opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
year Number Competition Year (or Season). Must be 4 digits.
ifModifiedSince String Value of the `Last-Modified` header in the most recently cached response by the client. [optional]

Return type

[DistrictList]

Authorization

apiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getEventDistrictPoints

EventDistrictPoints getEventDistrictPoints(eventKey, opts)

Gets a list of team rankings for the Event.

Example

import TbaApiV3client from 'tba-api-v3client';
let defaultClient = TbaApiV3client.ApiClient.instance;
// Configure API key authorization: apiKey
let 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 = 'Token';

let apiInstance = new TbaApiV3client.DistrictApi();
let eventKey = "eventKey_example"; // String | TBA Event Key, eg `2016nytr`
let opts = {
  'ifModifiedSince': "ifModifiedSince_example" // String | Value of the `Last-Modified` header in the most recently cached response by the client.
};
apiInstance.getEventDistrictPoints(eventKey, opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
eventKey String TBA Event Key, eg `2016nytr`
ifModifiedSince String Value of the `Last-Modified` header in the most recently cached response by the client. [optional]

Return type

EventDistrictPoints

Authorization

apiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getTeamDistricts

[DistrictList] getTeamDistricts(teamKey, opts)

Gets an array of districts representing each year the team was in a district. Will return an empty array if the team was never in a district.

Example

import TbaApiV3client from 'tba-api-v3client';
let defaultClient = TbaApiV3client.ApiClient.instance;
// Configure API key authorization: apiKey
let 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 = 'Token';

let apiInstance = new TbaApiV3client.DistrictApi();
let teamKey = "teamKey_example"; // String | TBA Team Key, eg `frc254`
let opts = {
  'ifModifiedSince': "ifModifiedSince_example" // String | Value of the `Last-Modified` header in the most recently cached response by the client.
};
apiInstance.getTeamDistricts(teamKey, opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
teamKey String TBA Team Key, eg `frc254`
ifModifiedSince String Value of the `Last-Modified` header in the most recently cached response by the client. [optional]

Return type

[DistrictList]

Authorization

apiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json