Module: FtcEventsClient

Defined in:
lib/ftc_events_client/version.rb,
lib/ftc_events_client.rb,
lib/ftc_events_client/api_error.rb,
lib/ftc_events_client/api_client.rb,
lib/ftc_events_client/models/point.rb,
lib/ftc_events_client/models/stone.rb,
lib/ftc_events_client/configuration.rb,
lib/ftc_events_client/api/awards_api.rb,
lib/ftc_events_client/api/general_api.rb,
lib/ftc_events_client/api/leagues_api.rb,
lib/ftc_events_client/models/envelope.rb,
lib/ftc_events_client/models/geometry.rb,
lib/ftc_events_client/api/rankings_api.rb,
lib/ftc_events_client/api/schedule_api.rb,
lib/ftc_events_client/models/dimension.rb,
lib/ftc_events_client/models/ordinates.rb,
lib/ftc_events_client/models/coordinate.rb,
lib/ftc_events_client/models/field_side.rb,
lib/ftc_events_client/api/advancement_api.rb,
lib/ftc_events_client/api/season_data_api.rb,
lib/ftc_events_client/models/awards_model.rb,
lib/ftc_events_client/api/match_results_api.rb,
lib/ftc_events_client/models/api_index_model.rb,
lib/ftc_events_client/models/auto_navigation.rb,
lib/ftc_events_client/models/barcode_element.rb,
lib/ftc_events_client/models/ftc_event_level.rb,
lib/ftc_events_client/models/precision_model.rb,
lib/ftc_events_client/models/selection_model.rb,
lib/ftc_events_client/models/advancement_slot.rb,
lib/ftc_events_client/models/geometry_factory.rb,
lib/ftc_events_client/models/geometry_overlay.rb,
lib/ftc_events_client/models/junction_element.rb,
lib/ftc_events_client/models/precision_models.rb,
lib/ftc_events_client/models/selection_result.rb,
lib/ftc_events_client/models/advancement_model.rb,
lib/ftc_events_client/models/end_game_location.rb,
lib/ftc_events_client/models/ogc_geometry_type.rb,
lib/ftc_events_client/models/match_scores_model.rb,
lib/ftc_events_client/models/team_ranking_model.rb,
lib/ftc_events_client/api/alliance_selection_api.rb,
lib/ftc_events_client/models/alliance_score_2020.rb,
lib/ftc_events_client/models/coordinate_sequence.rb,
lib/ftc_events_client/models/season_awards_model.rb,
lib/ftc_events_client/models/event_rankings_model.rb,
lib/ftc_events_client/models/auto_navigated_status.rb,
lib/ftc_events_client/models/endgame_parked_status.rb,
lib/ftc_events_client/models/nts_geometry_services.rb,
lib/ftc_events_client/models/api_advancement_status.rb,
lib/ftc_events_client/models/award_assignment_model.rb,
lib/ftc_events_client/models/alliance_model_version2.rb,
lib/ftc_events_client/models/score_detail_model_2019.rb,
lib/ftc_events_client/models/score_detail_model_2020.rb,
lib/ftc_events_client/models/score_detail_model_2021.rb,
lib/ftc_events_client/models/score_detail_model_2022.rb,
lib/ftc_events_client/models/score_detail_model_2023.rb,
lib/ftc_events_client/models/advancement_source_model.rb,
lib/ftc_events_client/models/league_member_list_model.rb,
lib/ftc_events_client/models/season_team_model_version2.rb,
lib/ftc_events_client/models/coordinate_sequence_factory.rb,
lib/ftc_events_client/models/match_result_model_version2.rb,
lib/ftc_events_client/models/season_award_listings_model.rb,
lib/ftc_events_client/models/season_event_model_version2.rb,
lib/ftc_events_client/models/coordinate_equality_comparer.rb,
lib/ftc_events_client/models/season_league_model_version2.rb,
lib/ftc_events_client/models/event_schedule_model_version2.rb,
lib/ftc_events_client/models/season_summary_model_version2.rb,
lib/ftc_events_client/models/schedule_hybrid_model_version2.rb,
lib/ftc_events_client/models/scheduled_match_model_version2.rb,
lib/ftc_events_client/models/alliance_selection_detail_model.rb,
lib/ftc_events_client/models/score_detail_single_player_2021.rb,
lib/ftc_events_client/models/score_detail_single_player_2022.rb,
lib/ftc_events_client/models/score_detail_single_player_2023.rb,
lib/ftc_events_client/models/match_result_team_model_version2.rb,
lib/ftc_events_client/models/score_detail_alliance_model_2020.rb,
lib/ftc_events_client/models/score_detail_alliance_model_2021.rb,
lib/ftc_events_client/models/score_detail_alliance_model_2022.rb,
lib/ftc_events_client/models/score_detail_alliance_model_2023.rb,
lib/ftc_events_client/models/score_detail_model_alliance_2019.rb,
lib/ftc_events_client/models/alliance_selection_model_version2.rb,
lib/ftc_events_client/models/season_summary_model_championship.rb,
lib/ftc_events_client/models/event_match_results_model_version2.rb,
lib/ftc_events_client/models/schedule_hybrid_model_team_version2.rb,
lib/ftc_events_client/models/scheduled_match_team_model_version2.rb,
lib/ftc_events_client/models/season_team_listings_model_version2.rb,
lib/ftc_events_client/models/event_schedule_hybrid_model_version2.rb,
lib/ftc_events_client/models/season_event_listings_model_version2.rb,
lib/ftc_events_client/models/score_detail_model_single_player_2020.rb,
lib/ftc_events_client/models/score_detail_model_single_player_2021.rb,
lib/ftc_events_client/models/score_detail_model_single_player_2022.rb,
lib/ftc_events_client/models/score_detail_model_single_player_2023.rb,
lib/ftc_events_client/models/season_league_listings_model_version2.rb,
lib/ftc_events_client/models/one_of_match_scores_model_match_scores_items.rb

Overview

#FTC Events API

#FTC Events API is a service to return relevant information about the FIRST Tech Challenge (FTC). Information is made available from events operating around the world Information is currently made available after the conclusion of the tournament. The API will provide data as soon as it has synced, and we do not add any artificial delays. ## Documentation Notes ### Timezones All times are listed in the local time to the event venue. HTTP-date values will show their timezone. ### Query Parameters If you specify a parameter, but no value for that parameter, it will be ignored. For example, if you request ‘URL?teamNumber=` the `teamNumber` parameter would be ignored. For all APIs that accept a query string in addition to the base URI, the order of parameters do not matter, but the name shown in the documentation must match exactly, as does the associated value format as described in details. For response codes that are not HTTP 200 (OK), the documentation will show a body message that represents a possible response value. While the "title" of the HTTP Status Code will match those shown in the response codes documentation section exactly, the body of the response will be a more detailed explanation of why that status code is being returned and may not always be exactly as shown in the examples. ### Experimenting with the API This documentation is rendered at both [api-docs](ftc-events.firstinspires.org/api-docs) and [try-it-out](ftc-events.firstinspires.org/try-it-out). [api-docs](ftc-events.firstinspires.org/api-docs) has a three panel, easy to read layout, while [try-it-out](ftc-events.firstinspires.org/try-it-out) has a feature that allows you try out endpoints from within the page. Additionally, the Open API Json is availabe at [Open API](ftc-events.firstinspires.org/swagger/v2.0/swagger.json). This can be imported into a tool such as [Postman](www.postman.com) for experimentation as well. ### Last-Modified, FMS-OnlyModifiedSince, and If-Modified-Since Headers The FTC Events API utilizes the `Last-Modified` and `If-Modified-Since` Headers to communicate with consumers regarding the age of the data they are requesting. With a couple of exceptions, all calls will return a `Last-Modified` Header set with the time at which the data at that endpoint was last modified. The Header will always be set in the HTTP-date format, as described in the HTTP Protocol. There are two exceptions: the `Last-Modified` Header is not set if the endpoint returns no results (such as a request for a schedule with no matches). Consumers should keep track of the `Last-Modified` Header, and return it on subsequent calls to the same endpoint as the If-Modified-Since. The server will recognize this request, and will only return a result if the data has been modified since the last request. If no changes have been made, an HTTP 304 will be returned. If data has been modified, ALL data on that call will be returned (for "only modified" data, see below). The FTC Events API also allows a custom header used to filter the return data to a specific subset. This is done by specifying a `FMS-OnlyModifiedSince` header with each call. As with the `If-Modified-Since` header, consumers should keep track of the Last-Modified Header, and return it on subsequent calls to the same endpoint as the `FMS-OnlyModifiedSince` Header. The server will recognize this request, and will only return a result if the data has been modified since the last request, and, if returned, the data will only be those portions modified since the included date. If no changes, have been made, an HTTP 304 will be returned. Using this method, the server and consumer save processing time by only receiving modified data that is in need of update on the consumer side. If the Headers are improperly passed (such as the wrong Day of Week for the matching date, or a date in the future), the endpoint will simply ignore the Header and return all results. If both headers are specified, the request will be denied. ## Response Codes The FTC Events API HTTP Status Codes correspond with the [common codes](www.w3.org/Protocols/rfc2616/rfc2616-sec10.html), but occasionally with different "titles". The "title" used by the API is shown next to each of the below possible response HTTP Status Codes. Throughout the documentation, Apiary may automatically show the common "title" in example returns (like "Not Found" for 404) but on the production server, the "title" will instead match those listed below. ### HTTP 200 - "OK" The request has succeeded. An entity corresponding to the requested resource is sent in the response. This will be returned as the HTTP Status Code for all request that succeed, even if the body is empty (such as an event that has no rankings, but with a valid season and event code were used) ### HTTP 304 - "Not Modified" When utilizing a Header that allows filtered data returns, such as `If-Modified-Since`, this response indicates that no data meets the request. ### HTTP 400 - "Invalid Season Requested"/"Malformed Parameter Format In Request"/"Missing Parameter In Request"/"Invalid API Version Requested": The request could not be understood by the server due to malformed syntax. The client SHOULD NOT repeat the request without modifications. Specifically for this API, a 400 response indicates that the requested URI matches with a valid API, but one or more required parameter was malformed or invalid. Examples include an event code that is too short or team number that contains a letter. ### HTTP 401 - "Unauthorized" All requests against the API require authentication via a valid user token. Failing to provide one, or providing an invalid one, will warrant a 401 response. The client MAY repeat the request with a suitable Authorization header field. ### HTTP 404 - "Invalid Event Requested" Even though the 404 code usually indicates any not found status, a 404 will only be issued in this API when an event cannot be found for the requested season and event code. If the request didn’t match a valid API or there were malformed parameters, the response would not receive a 404 but rather a 400 or 501. If this HTTP code is received, the season was a valid season and the event code matched the acceptable style of an event code, but there were no records of an event matching the combination of that season and event code. For example, HTTP 404 would be issued when the event had a different code in the requested season (the codes can change year to year based on event location). ### HTTP 500 - "Internal Server Error" The server encountered an unexpected condition which prevented it from fulfilling the request. This is a code sent directly by the server, and has no special alternate definition specific to this API. ### HTTP 501 - "Request Did Not Match Any Current API Pattern" The server does not support the functionality required to fulfill the request. Specifically, the request pattern did not match any of the possible APIs, and thus processing was discontinued. This code is also issued when too many optional parameters were included in a single request and fulfilling it would make the result confusing or misleading. Each API will specify which parameters or combination of parameters can be used at the same time. ### HTTP 503 - "Service Unavailable" The server is currently unable to handle the request due to a temporary overloading or maintenance of the server. The implication is that this is a temporary condition which will be alleviated after some delay. If known, the length of the delay MAY be indicated in a ‘Retry-After` header. This code will not always appear, sometimes the server may outright refuse the connection instead. This is a code sent directly by the server, and has no special alternate definition specific to this API. ## Authorization In order to make calls against the FTC Events API, you must include an HTTP Header called `Authorization` with the value set as specified below. If a request is made without this header, processing stops and an HTTP 401 is issued. All `Authorization` headers follow the same format: “` Authorization: Basic 000000000000000000000000000000000000000000000000000000000000 “` Where the Zeros are replaced by your Token. The Token can be formed by taking your username and your AuthorizationKey and adding a colon. For example, if your username is `sampleuser` and your AuthorizationKey is `7eaa6338-a097-4221-ac04-b6120fcc4d49` you would have this string: “` sampleuser:7eaa6338-a097-4221-ac04-b6120fcc4d49 “` This string must then be encoded using Base64 Encoded to form the Token, which will be the same length as the example above, but include letters and numbers. For our example, we would have: “` c2FtcGxldXNlcjo3ZWFhNjMzOC1hMDk3LTQyMjEtYWMwNC1iNjEyMGZjYzRkNDk= “` Most API client libraries can handle computing the authorization header using a username and password for you NOTICE: Publicly distributing an application, code snippet, etc, that has your username and token in it, encoded or not, WILL result in your token being blocked from the API. Each user should apply for their own token. If you wish to acquire a token for your development, you may do so by requesting a token through our automated system on this website.

OpenAPI spec version: v2.0

Generated by: github.com/swagger-api/swagger-codegen.git Swagger Codegen version: 3.0.52

Defined Under Namespace

Classes: AdvancementApi, AdvancementModel, AdvancementSlot, AdvancementSourceModel, AllianceModelVersion2, AllianceScore2020, AllianceSelectionApi, AllianceSelectionDetailModel, AllianceSelectionModelVersion2, ApiAdvancementStatus, ApiClient, ApiError, ApiIndexModel, AutoNavigatedStatus, AutoNavigation, AwardAssignmentModel, AwardsApi, AwardsModel, BarcodeElement, Configuration, Coordinate, CoordinateEqualityComparer, CoordinateSequence, CoordinateSequenceFactory, Dimension, EndGameLocation, EndgameParkedStatus, Envelope, EventMatchResultsModelVersion2, EventRankingsModel, EventScheduleHybridModelVersion2, EventScheduleModelVersion2, FTCEventLevel, FieldSide, GeneralApi, Geometry, GeometryFactory, GeometryOverlay, JunctionElement, LeagueMemberListModel, LeaguesApi, MatchResultModelVersion2, MatchResultTeamModelVersion2, MatchResultsApi, MatchScoresModel, NtsGeometryServices, OgcGeometryType, OneOfMatchScoresModelMatchScoresItems, Ordinates, Point, PrecisionModel, PrecisionModels, RankingsApi, ScheduleApi, ScheduleHybridModelTeamVersion2, ScheduleHybridModelVersion2, ScheduledMatchModelVersion2, ScheduledMatchTeamModelVersion2, ScoreDetailAllianceModel2020, ScoreDetailAllianceModel2021, ScoreDetailAllianceModel2022, ScoreDetailAllianceModel2023, ScoreDetailModel2019, ScoreDetailModel2020, ScoreDetailModel2021, ScoreDetailModel2022, ScoreDetailModel2023, ScoreDetailModelAlliance2019, ScoreDetailModelSinglePlayer2020, ScoreDetailModelSinglePlayer2021, ScoreDetailModelSinglePlayer2022, ScoreDetailModelSinglePlayer2023, ScoreDetailSinglePlayer2021, ScoreDetailSinglePlayer2022, ScoreDetailSinglePlayer2023, SeasonAwardListingsModel, SeasonAwardsModel, SeasonDataApi, SeasonEventListingsModelVersion2, SeasonEventModelVersion2, SeasonLeagueListingsModelVersion2, SeasonLeagueModelVersion2, SeasonSummaryModelChampionship, SeasonSummaryModelVersion2, SeasonTeamListingsModelVersion2, SeasonTeamModelVersion2, SelectionModel, SelectionResult, Stone, TeamRankingModel

Constant Summary collapse

VERSION =
'0.3.2'

Class Method Summary collapse

Class Method Details

.configureObject

Customize default settings for the SDK using block.

FtcEventsClient.configure do |config|
  config.username = "xxx"
  config.password = "xxx"
end

If no block given, return the default Configuration object.



117
118
119
120
121
122
123
# File 'lib/ftc_events_client.rb', line 117

def configure
  if block_given?
    yield(Configuration.default)
  else
    Configuration.default
  end
end