Get all Channel points redemptions for client_id

According to the API docs when calling https://api.twitch.tv/helix/channel_points/custom_rewards/redemptions without a reward ID I should

Returns Custom Reward Redemption objects for a Custom Reward on a channel that was created by the same client_id .

Which my understanding means we can call the API without a reward_id and get all the redemptions for the rewards my client_id has created however a few lines down in the documentation also says that reward_id is a required parameter

My aim is for my app to create probably around 12-16 rewards and then poll for redemptions for them. (The creating rewards works fine, I have a few created so far for testing, cerated through my app/client_id)

I was taking inspiration from the Twitch Channel points Node sample on github, but when calling the API without a reward_id like so:

let {body} = await got(`https://api.twitch.tv/helix/channel_points/custom_rewards/redemptions?broadcaster_id=${userId}&status=UNFULFILLED`, {
            headers: headers,
            responseType: 'json',
        });

I just get a bad request HTTPError: Response code 400 (Bad Request)
But if i specify a reward ID i get the redemptions for that ID, what am i missing/doing wrong?

Read the body of the response not just the HTTP code.

That’ll tell you the issue.

You will find the response is

{
  error: 'Bad Request',
  status: 400,
  message: 'Missing required parameter "reward_id"'
}

A reward_id is required.

When it says When ID is not provided it means the optional query string parameter of id

IE you either look up redeems by up to 50 single redeem ID’s or by one rewardID

Consider using EventSub to be notified of a redemption instead of long polling

1 Like

Consider using EventSub to be notified of a redemption instead of long polling

Good shout, i’d completly forgotten about EventSub.

Cheers Barry

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.