# Clips - error 404

**URL:** <https://discuss.dev.twitch.com/t/clips-error-404/9305>\
**Category:** API\
**Created:** [February 18, 2017, 1:21pm UTC](https://discuss.dev.twitch.com/t/clips-error-404/9305 "2017-02-18T13:21:26Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Homer](https://avatars.discourse-cdn.com/v4/letter/h/df788c/32.png) [@Homer](https://discuss.dev.twitch.com/u/Homer)\
**Post date:** [February 18, 2017, 1:21pm UTC](https://discuss.dev.twitch.com/t/clips-error-404/9305/1 "2017-02-18T13:21:26Z")

</div>

Hi.

I would like to get json data of clips. Response:

{“error”:“Not Found”,“status”:404,“message”:“Clip does not exist”}

Another data like channel, streams is OK.

---

<div class="post-metadata">

**Author:** ![3ventic](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/3ventic/32/298_2.png) [@3ventic](https://discuss.dev.twitch.com/u/3ventic)\
**Post date:** [February 18, 2017, 1:35pm UTC](https://discuss.dev.twitch.com/t/clips-error-404/9305/2 "2017-02-18T13:35:10Z")

</div>

Are you requesting from API v4 like required for clips?

Example request:

```auto
GET /kraken/clips/streamcorner/BraveWallabyMikeHogu HTTP/1.1
Accept: application/vnd.twitchtv.v4+json
Host: api.twitch.tv
Client-Id: d12jokwzby5m9e82gouqsjogd66inh

HTTP/1.1 200 OK
Date: Sat, 18 Feb 2017 13:40:33 GMT
Content-Type: application/json
Content-Length: 1525
Connection: keep-alive
Server: nginx
Access-Control-Allow-Headers: Accept, Authorization, Client-Id, Twitch-Api-Token, X-Forwarded-Proto, X-Requested-With, X-Csrf-Token, Content-Type
Access-Control-Allow-Methods: GET, POST, PUT, DELETE
Access-Control-Allow-Origin: *
Access-Control-Max-Age: 0
Twitch-Trace-Id: c900eff715f7a60b1cf8f3364c05601e
Front-End-Https: on

{"id":"streamcorner/BraveWallabyMikeHogu","url":"https://clips.twitch.tv/streamcorner/BraveWallabyMikeHogu?tt_medium=clips_api\u0026tt_content=url","embed_url":"https://clips.twitch.tv/embed?clip=streamcorner/BraveWallabyMikeHogu\u0026tt_medium=clips_api\u0026tt_content=embed","embed_html":"\u003ciframe src='https://clips.twitch.tv/embed?clip=streamcorner/BraveWallabyMikeHogu\u0026tt_medium=clips_api\u0026tt_content=embed' width='640' height='360' frameborder='0' scrolling='no' allowfullscreen='true'\u003e\u003c/iframe\u003e","broadcaster":{"id":"81300244","name":"streamcorner","display_name":"StreamCorner","channel_url":"https://www.twitch.tv/streamcorner","logo":"https://static-cdn.jtvnw.net/jtv_user_pictures/streamcorner-profile_image-a26d8edacc37c672-300x300.jpeg"},"curator":{"id":"17089325","name":"3v","display_name":"3v","channel_url":"https://www.twitch.tv/3v","logo":"https://static-cdn.jtvnw.net/jtv_user_pictures/3v-profile_image-aaa5f1b8946fa6b9-300x300.png"},"vod":{"id":"119593832","url":"https://www.twitch.tv/videos/119593832?t=14h45m17s"},"game":"Overwatch","title":"IS Striimicorner Assembly Winter 2017 @ Messukeskus, Helsinki, Finland","views":9,"duration":44,"created_at":"2017-02-05T17:26:53Z","thumbnails":{"medium":"https://clips-media-assets.twitch.tv/24428270176-offset-53074-44-preview-480x272.jpg","small":"https://clips-media-assets.twitch.tv/24428270176-offset-53074-44-preview-260x147.jpg","tiny":"https://clips-media-assets.twitch.tv/24428270176-offset-53074-44-preview-86x45.jpg"}}

```

---

<div class="post-metadata">

**Author:** ![Homer](https://avatars.discourse-cdn.com/v4/letter/h/df788c/32.png) [@Homer](https://discuss.dev.twitch.com/u/Homer)\
**Post date:** [February 18, 2017, 1:56pm UTC](https://discuss.dev.twitch.com/t/clips-error-404/9305/3 "2017-02-18T13:56:29Z")

</div>

I use PHP + CURL:

```
public function getTwitch($url){
        $channelsApi = $url;
        $channelName = 'twitch';
        $clientId = 'xxx';
        $ch = curl_init();

        curl_setopt_array($ch, array(
           CURLOPT_HTTPHEADER => array(
              'Client-ID: ' . $clientId,
              'Accept: application/vnd.twitchtv.v4+json'
           ),
           CURLOPT_RETURNTRANSFER => true,
           CURLOPT_URL => $channelsApi . $channelName
        ));

        $response = curl_exec($ch);

        
        curl_close($ch);
        
        return $response;
    }
```

---

<div class="post-metadata">

**Author:** ![3ventic](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/3ventic/32/298_2.png) [@3ventic](https://discuss.dev.twitch.com/u/3ventic)\
**Post date:** [February 18, 2017, 2:03pm UTC](https://discuss.dev.twitch.com/t/clips-error-404/9305/4 "2017-02-18T14:03:59Z")

</div>

That gets the channel(?) and looks fine… (although you should use v4 only for clips and v5 for everything else, v3 is fine but should be avoided for new development)

---

<div class="post-metadata">

**Author:** ![Homer](https://avatars.discourse-cdn.com/v4/letter/h/df788c/32.png) [@Homer](https://discuss.dev.twitch.com/u/Homer)\
**Post date:** [February 18, 2017, 2:32pm UTC](https://discuss.dev.twitch.com/t/clips-error-404/9305/5 "2017-02-18T14:32:46Z")

</div>

> [@3ventic](#):
>
> That gets the channel(?) and looks fine… (although you should use v4 only for clips and v5 for everything else, v3 is fine but should be avoided for new development)

I changed to v5 and is the same problem - error 404. Clips is exist, but message is:

Clip does not exist

https://clips.twitch.tv/embed?clip=playhearthstone/HelpfulYakBigBrother&parent=discuss.dev.twitch.com&autoplay=false

CURL url look like:

[https://api.twitch.tv/kraken/clips/playhearthstone/HelpfulYakBigBrother](https://api.twitch.tv/kraken/clips/playhearthstone/HelpfulYakBigBrother)

---

<div class="post-metadata">

**Author:** ![3ventic](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/3ventic/32/298_2.png) [@3ventic](https://discuss.dev.twitch.com/u/3ventic)\
**Post date:** [February 18, 2017, 2:34pm UTC](https://discuss.dev.twitch.com/t/clips-error-404/9305/6 "2017-02-18T14:34:46Z")

</div>

Your code is appending `twitch` to the end of `$url`

---

<div class="post-metadata">

**Author:** ![Homer](https://avatars.discourse-cdn.com/v4/letter/h/df788c/32.png) [@Homer](https://discuss.dev.twitch.com/u/Homer)\
**Post date:** [February 18, 2017, 3:19pm UTC](https://discuss.dev.twitch.com/t/clips-error-404/9305/7 "2017-02-18T15:19:05Z")

</div>

My 3 function to get data:

```
public function getTwitch($url){
        $channelsApi = $url;
        $channelName = 'twitch';
        $clientId = 'xxx';
        $ch = curl_init();

        curl_setopt_array($ch, array(
           CURLOPT_HTTPHEADER => array(
              'Client-ID: ' . $clientId,
              'Accept: application/vnd.twitchtv.v4+json'
           ),
           CURLOPT_RETURNTRANSFER => true,
           CURLOPT_URL => $channelsApi . $channelName
        ));

        $response = curl_exec($ch);

        
        curl_close($ch);
        
        return $response;
    }

```

I choose type of data:

```
public function getApiUri($type) {
		$apiUrl = "https://api.twitch.tv/kraken";
		$apiCalls = array(
			"streams" => $apiUrl."/streams/",
			"search" => $apiUrl."/search/",
			"channel" => $apiUrl."/channels/",
			"user" => $apiUrl."/user/",
			"teams" => $apiUrl."/teams/",
                        "clips" => $apiUrl."/clips/",
		);
		return $apiCalls[$type];
	}

```

And I try to get Clip’s data:

```
        public function GetClip($url) {
		
                $s = $this->getTwitch($this->getApiUri("clips").$url);
		//$json = json_decode($s, true);
		
                return $s;
	}

```

`return $s` is temporary

And… for example:

$clip-\>GetClip(‘playhearthstone/HelpfulYakBigBrother’);

---

<div class="post-metadata">

**Author:** ![3ventic](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/3ventic/32/298_2.png) [@3ventic](https://discuss.dev.twitch.com/u/3ventic)\
**Post date:** [February 18, 2017, 4:38pm UTC](https://discuss.dev.twitch.com/t/clips-error-404/9305/8 "2017-02-18T16:38:24Z")

</div>

```auto
CURLOPT_URL => $channelsApi . $channelName

```

makes it `https://api.twitch.tv/kraken/clips/playhearthstone/HelpfulYakBigBrothertwitch`, no?

---

<div class="post-metadata">

**Author:** ![Homer](https://avatars.discourse-cdn.com/v4/letter/h/df788c/32.png) [@Homer](https://discuss.dev.twitch.com/u/Homer)\
**Post date:** [February 18, 2017, 5:39pm UTC](https://discuss.dev.twitch.com/t/clips-error-404/9305/9 "2017-02-18T17:39:26Z")

</div>

Yeah, thank you! It’s works!

Stupid mistake from me 🙂

---

<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:** [March 20, 2017, 5:39pm UTC](https://discuss.dev.twitch.com/t/clips-error-404/9305/10 "2017-03-20T17:39:26Z")

</div>

Closed on March 20, 2017, 5:39pm UTC

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