Available on crate feature helix only.
Expand description

Get information about all polls or specific polls for a Twitch channel. Poll information is available for 90 days. get-polls

Request: GetPollsRequest

To use this endpoint, construct a GetPollsRequest with the GetPollsRequest::builder() method.

use twitch_api2::helix::polls::get_polls;
let request = get_polls::GetPollsRequest::builder()
    .id(vec!["ed961efd-8a3f-4cf5-a9d0-e616c590cd2a".into()])
    .broadcaster_id("1234")
    .build();

Response: Poll

Send the request to receive the response with HelixClient::req_get().

use twitch_api2::helix::{self, polls::get_polls};
let request = get_polls::GetPollsRequest::builder()
    .id(vec!["ed961efd-8a3f-4cf5-a9d0-e616c590cd2a".into()])
    .broadcaster_id("1234")
    .build();
let response: Vec<get_polls::Poll> = 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 GetPollsRequest::parse_response(None, &request.get_uri(), response)

Re-exports

pub use types::PollChoice;
pub use types::PollStatus;

Structs

Query Parameters for Get polls

Return Values for Get polls