Module twitch_api2::helix::bits::get_bits_leaderboard [−][src]
This is supported on crate feature
helix
only.Gets a ranked list of Bits leaderboard information for an authorized broadcaster.
get-bits-leaderboard
Accessing the endpoint
Request: GetBitsLeaderboardRequest
To use this endpoint, construct a GetBitsLeaderboardRequest
with the GetBitsLeaderboardRequest::builder()
method.
Provide started_at
and period
to get a different leaderboard than default
use twitch_api2::helix::bits::get_bits_leaderboard; let request = get_bits_leaderboard::GetBitsLeaderboardRequest::builder() .started_at("2020-01-01T07:00:00Z".to_string()) .period("day".to_string()) .build(); // Get leaderbord for the lifetime of the channel let request = get_bits_leaderboard::GetBitsLeaderboardRequest::builder().build();
Response: BitsLeaderboard
Send the request to receive the response with HelixClient::req_get()
.
use twitch_api2::helix::{self, bits::get_bits_leaderboard}; let request = get_bits_leaderboard::GetBitsLeaderboardRequest::builder().build(); let response: get_bits_leaderboard::BitsLeaderboard = client.req_get(request, &token).await?.data;
You can also get the http::Request
with request.create_request(&token, &client_id)
and parse the http::Response
with request.parse_response(&request.get_uri()?)
Structs
BitsLeaderboard | Return Values for Get Bits Leaderboard |
DateRange | Period over which the returned data is aggregated. |
GetBitsLeaderboardRequest | Query Parameters for Get Bits Leaderboard |
LeaderboardUser | Information about user in leaderboard |