Module twitch_api2::helix::points::create_custom_rewards
source · [−]Available on crate feature
helix
only.Expand description
Adds a specified user to the followers of a specified channel.
create-custom-rewards
Accessing the endpoint
Request: CreateCustomRewardRequest
To use this endpoint, construct a CreateCustomRewardRequest
with the CreateCustomRewardRequest::builder()
method.
use twitch_api2::helix::points::create_custom_rewards;
let request = create_custom_rewards::CreateCustomRewardRequest::builder()
.broadcaster_id("274637212")
.build();
Body: CreateCustomRewardBody
We also need to provide a body to the request containing what we want to change.
let body = create_custom_rewards::CreateCustomRewardBody::builder()
.cost(500)
.title("hydrate!")
.build();
Response: CreateCustomRewardResponse
Send the request to receive the response with HelixClient::req_post()
.
use twitch_api2::helix::{self, points::create_custom_rewards};
let request = create_custom_rewards::CreateCustomRewardRequest::builder()
.broadcaster_id("274637212")
.build();
let body = create_custom_rewards::CreateCustomRewardBody::builder()
.cost(500)
.title("hydrate!")
.build();
let response: create_custom_rewards::CreateCustomRewardResponse = client.req_post(request, body, &token).await?.data;
You can also get the http::Request
with request.create_request(&token, &client_id)
and parse the http::Response
with CreateCustomRewardRequest::parse_response(None, &request.get_uri(), response)
Structs
Body Parameters for Create Custom Rewards
Query Parameters for Create Custom Rewards
Type Definitions
Return Values for Create Custom Rewards