Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

To be able to connect to Ably channel you will need to know the Fixture ID. You can get the fixtures with available feeds using the MS Match State Platform Schedule API.

Code Block
languagec#
var sourceId = "GeniusPremium";
var sportId = 17; // American Football
var from = DateTime.UtcNow.ToString("s");
var to = DateTime.UtcNow.AddDays(2).ToString("s");
var baseUrl = "https://platform.matchstate.api.geniussports.com/api/v1";
var url = $"{baseUrl}/sources/{sourceId}/sports/{sportId}/schedule?from={from}&to={to}";

var httpClient = new HttpClient();
httpClient.DefaultRequestHeaders.Add("Authorization", "{ACCESS_TOKEN}");
httpClient.DefaultRequestHeaders.Add("x-api-key", "{API_KEY}");

var response = await httpClient.GetAsync(url);
var responseBody = await response.Content.ReadAsStringAsync();

var schedule = JsonConvert.DeserializeObject<JArray>(responseBody);
var fixtureId = schedule[0]["fixtureId"].ToString();

...

Important: The FIXTURE_ID should be scheduled in a period of 7 days in the future, by the MS Match State Platform Schedule API in order for the Access Control API to return a channel & token.

...