Versions Compared

Key

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

...

Code Block
languagec#
var url = "https://auth.api.geniussports.com/oauth2/token";
var body = new Dictionary<string, string> {
	{"grant_type", "client_credentials"},
	{"client_id", "CLIENT_ID"},
	{"client_secret", "CLIENT_SECRET"}
};

var httpClient = new HttpClient();
var response = await httpClient.PostAsync(url, new FormUrlEncodedContent(body));
var responseBody = await response.Content.ReadAsStringAsync();

var tokenEnvelope = JsonConvert.DeserializeObject<JObject>(responseBody);
var accessToken = tokenEnvelope["access_token"].ToString();
Info

Please refer to Authenticating against Genius Sports APIs for more information about authenticating against our API’s in both the User Acceptance Testing and Production environments.

2. Consuming the Fixture Schedule

...