ModifyChannelInformation API call requires broadcaster_id based OAuth token
WrithemTwine opened this issue · 4 comments
The "ModifyChannelInformation(...)" receives a "ModifyChannelInformationRequest" object.
Per the API doc, https://dev.twitch.tv/docs/api/reference#modify-channel-information, any parameter is optional but at least one is required. However, the TwitchLib API call would require all parameters and throws a null parameter exception when providing one or a few parameters.
Should the API call be modified for only provided parameters (like a null check ignore param) or this call documented to require all parameters (different than the Twitch API) ?
The primary issue is making one Twitch API call to get the current stream params, and another API call sending back those same params with the updated param.
NullValueHandling.Ignore
was added to all properties of ModifyChannelInformationRequest
in #204
what version of the package are you using?
Thank you for your quick response. I thought the "broadcaster_id" was assigned and it was the cause of the null exception. Just debugged and code correctly handles the API call.
However, I would note, the Twitch API doc doesn't directly specify but I can confirm "Provided broadcaster_id must match the user_id in the user OAuth token."
Provided broadcaster_id must match the user_id in the user OAuth token
you might be able to get away with using an editor's access token (with the proper scope), iirc
Twitch should specify the possibilities in the API doc, though, to be clearer for access. The actual current doc implies any account can access (but logically didn't make sense a streamer could let 'any' bot change their channel info). My bot is already a channel moderator and still got a 'bad credential' exception in the API call.
the bot I'm writing is open to general users who might not understand that nuance, or the setup burden I'm trying to minimize to just a couple client Ids and scope/tokens. I already have a mechanism for choosing either a bot account credential or streamer account credential depending on the required access (i.e. channel point redemptions is streamer account required, in both Helix-list and PubSub-redemption).
We can close issue, if nothing else.