thormug
February 19, 2020, 1:37pm
1
When doing a request on this endpoint :
https://api.twitch.tv/kraken/channels/00000000/commercial
you are supposed to received a 422 Unprocessable Entity if you entered an invalid length, if you launch 2 ads in the restrictive 8 minutes windows, if your channel is offline etc …
But instead, you receive a 500 Internal Server Error.
It makes debugging really annoying.
This is documented on the Github and ticketed by Twitch. Expect a fix soon
opened 12:05AM - 07 Dec 19 UTC
closed 05:12PM - 13 Apr 23 UTC
no action
product: v5
ticketed
**Brief description**
The Star Channel Commercial returns incorrect error respo… nses, as well as sending a 'success' response in a situation it should fail.
**How to reproduce**
Use the https://dev.twitch.tv/docs/v5/reference/channels#start-channel-commercial endpoint.
If the channel is offline a 500 error is returned.
If the channel is live and hasn't run an ad recently, a 'success' message is returned `{ Message: 'Starting commercial break. Keep in mind you are still live and not all viewers will receive a commercial.', Length: 30, RetryAfter: 480 }` which is correct for Affiliates/Partners, but a normal user should not be receiving this as no ads can actually be run.
If the channel is live and has run an ad recently (within the 'retry after' window) a 500 error is returned.
**Expected behavior**
The documentation specifically states that running an ad too quickly, as well as attempting to run for a non partner/affiliate, there should be a 422 Unprocessable Entity,
There's no documented behaviour for an offline stream, but it should respond with either a 422, or follow the behaviour of other endpoints which require a stream to be live such as the Create Channel Marker endpoint and return a 404.
None of these errors should be 500's.
**Additional context or questions**
No equivalent Helix endpoint exists for this, so while this is a deprecated endpoint it is something we need to rely on so correct responses is important.
1 Like
system
Closed
March 20, 2020, 1:54pm
3
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.