# Commercial API gone?

**URL:** <https://discuss.dev.twitch.com/t/commercial-api-gone/25869>\
**Category:** API\
**Created:** [May 23, 2020, 9:34pm UTC](https://discuss.dev.twitch.com/t/commercial-api-gone/25869 "2020-05-23T21:34:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![smokey019](https://avatars.discourse-cdn.com/v4/letter/s/df788c/32.png) [@smokey019](https://discuss.dev.twitch.com/u/smokey019)\
**Post date:** [May 23, 2020, 9:34pm UTC](https://discuss.dev.twitch.com/t/commercial-api-gone/25869/1 "2020-05-23T21:34:24Z")

</div>

I’m trying to run advertisements, and I’m getting a v3 error for v5 API?

```
Array
(
    [error] => Gone
    [status] => 410
    [message] => It's time to kick ass and serve v3... and I'm all outta v3. See https://dev.twitch.tv/docs
)

```

API I’m trying to access:  
`'https://api.twitch.tv/kraken/channels/' . $_REQUEST['id'] . '/commercial'`

If I change the header to accept V5 api it just gives me an internal error. Any ideas?

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [May 23, 2020, 9:37pm UTC](https://discuss.dev.twitch.com/t/commercial-api-gone/25869/2 "2020-05-23T21:37:44Z")

</div>

You need the v5 header.

And you might get a 500 error, instead of a 4x error, on channels that can’t run commercials or is offline.

As a channel needs to be affilaite+ to run ads, and needs to be live

That API was working as expected when I last ran ads a few hours ago.

---

<div class="post-metadata">

**Author:** ![smokey019](https://avatars.discourse-cdn.com/v4/letter/s/df788c/32.png) [@smokey019](https://discuss.dev.twitch.com/u/smokey019)\
**Post date:** [May 23, 2020, 9:39pm UTC](https://discuss.dev.twitch.com/t/commercial-api-gone/25869/3 "2020-05-23T21:39:21Z")

</div>

I wonder if there’s any chance Twitch can actually give us some real error messages? So I’m not so confused when problems like this arise…

I can’t test while offline, it’s hard to just “test” ads while online. Would be nice if Twitch gave us some more options for testing things.

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [May 23, 2020, 10:32pm UTC](https://discuss.dev.twitch.com/t/commercial-api-gone/25869/4 "2020-05-23T22:32:47Z")

</div>

> <https://github.com/twitchdev/issues/issues/7>
>
> \*\*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.

The issue is open as a issue on the bug tracker wrt the 500’s

---

<div class="post-metadata">

**Author:** ![system](https://d2opxh93rbxzdn.cloudfront.net/original/2X/0/05909729875cce3b53e59d5561c4d23bb14948fc.png) [@system](https://discuss.dev.twitch.com/u/system)\
**Post date:** [June 22, 2020, 10:32pm UTC](https://discuss.dev.twitch.com/t/commercial-api-gone/25869/5 "2020-06-22T22:32:50Z")

</div>

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