# Twitch api how to user follow and unfollow

**URL:** <https://discuss.dev.twitch.com/t/twitch-api-how-to-user-follow-and-unfollow/20175>\
**Category:** API\
**Created:** [February 23, 2019, 12:39pm UTC](https://discuss.dev.twitch.com/t/twitch-api-how-to-user-follow-and-unfollow/20175 "2019-02-23T12:39:40Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![alisahanyalcin](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/alisahanyalcin/32/5854_2.png) [@alisahanyalcin](https://discuss.dev.twitch.com/u/alisahanyalcin)\
**Post date:** [February 23, 2019, 12:39pm UTC](https://discuss.dev.twitch.com/t/twitch-api-how-to-user-follow-and-unfollow/20175/1 "2019-02-23T12:39:40Z")

</div>

Hello to everyone,  
I want to create a platform using Twitch api.  
I want to use many features such as logging in, watching live broadcasts, joining a conversation but I’m having trouble follow and unfollow tracking not ( Sorry for typos 🙂 )  
codes I use:  
$th = curl\_init();

```
    curl_setopt(
        $th, 
        CURLOPT_HTTPHEADER,
        array(
            'Accept: application/vnd.twitchtv.v5+json',
            'Client-ID:'$client,
            'Authorization: OAuth '. $tokenns,
            'Host: api.twitch.tv',
            'User-Agent: curl/7.43.0'
        )
    );
    curl_setopt($th, CURLOPT_URL, 'https://api.twitch.tv/kraken/users/'.$yid.'/blocks/'.$myid);
    curl_setopt($th, CURLOPT_RETURNTRANSFER, 1);
    $t = curl_exec($th);
    // $stast = json_decode($t,true);
    curl_close($th);
    echo $t;

```

this is the result of:  
{

error: “Not Found”,

status: 404,

message: “Follow not found”

}  
**Do you have any idea what you can do?**

---

<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:** [February 23, 2019, 12:43pm UTC](https://discuss.dev.twitch.com/t/twitch-api-how-to-user-follow-and-unfollow/20175/2 "2019-02-23T12:43:05Z")

</div>

You have posted code relating to “blocks”

Follows is documented here:

> **[Reference](https://dev.twitch.tv/docs/api/reference/)**
>
> Twitch Developer tools and services to integrate Twitch into your development or create interactive experience on twitch.tv.

UnFollow here:

> **[Reference](https://dev.twitch.tv/docs/api/reference/)**
>
> Twitch Developer tools and services to integrate Twitch into your development or create interactive experience on twitch.tv.

---

<div class="post-metadata">

**Author:** ![alisahanyalcin](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/alisahanyalcin/32/5854_2.png) [@alisahanyalcin](https://discuss.dev.twitch.com/u/alisahanyalcin)\
**Post date:** [February 23, 2019, 3:59pm UTC](https://discuss.dev.twitch.com/t/twitch-api-how-to-user-follow-and-unfollow/20175/3 "2019-02-23T15:59:54Z")

</div>

I was trying the blocking code  
the code I use to track this way:  
curl\_setopt($th, CURLOPT\_URL, ‘[https://api.twitch.tv/kraken/users/’.$myid.’/follows/channels/](https://api.twitch.tv/kraken/users/'.%24myid.'/follows/channels/)’.$yid);

---

<div class="post-metadata">

**Author:** ![alisahanyalcin](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/alisahanyalcin/32/5854_2.png) [@alisahanyalcin](https://discuss.dev.twitch.com/u/alisahanyalcin)\
**Post date:** [February 23, 2019, 6:51pm UTC](https://discuss.dev.twitch.com/t/twitch-api-how-to-user-follow-and-unfollow/20175/4 "2019-02-23T18:51:03Z")

</div>

can you help me please

---

<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:** [February 23, 2019, 6:52pm UTC](https://discuss.dev.twitch.com/t/twitch-api-how-to-user-follow-and-unfollow/20175/5 "2019-02-23T18:52:21Z")

</div>

> [@alisahanyalcin](#):
>
> {
> 
> error: “Not Found”,
> 
> status: 404,
> 
> message: “Follow not found”
> 
> }

This means there is no follow to unfollow.

I’ve linked the docs, not sure what else you need there?

---

<div class="post-metadata">

**Author:** ![alisahanyalcin](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/alisahanyalcin/32/5854_2.png) [@alisahanyalcin](https://discuss.dev.twitch.com/u/alisahanyalcin)\
**Post date:** [February 23, 2019, 7:09pm UTC](https://discuss.dev.twitch.com/t/twitch-api-how-to-user-follow-and-unfollow/20175/7 "2019-02-23T19:09:37Z")

</div>

I want the users to follow each other and I get an error.  
for example:  
I want a user b to follow  
did you understand me?

---

<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:** [February 23, 2019, 7:22pm UTC](https://discuss.dev.twitch.com/t/twitch-api-how-to-user-follow-and-unfollow/20175/8 "2019-02-23T19:22:38Z")

</div>

Whats the error?

---

<div class="post-metadata">

**Author:** ![alisahanyalcin](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/alisahanyalcin/32/5854_2.png) [@alisahanyalcin](https://discuss.dev.twitch.com/u/alisahanyalcin)\
**Post date:** [February 23, 2019, 7:26pm UTC](https://discuss.dev.twitch.com/t/twitch-api-how-to-user-follow-and-unfollow/20175/9 "2019-02-23T19:26:19Z")

</div>

![image](https://d2opxh93rbxzdn.cloudfront.net/original/2X/9/94e5bd99525a1d894ff66d580786cfc535463692.png)  
such a result is returning but does not follow

edit:  
in the meantime, if they follow each other this result comes out  
if a user does not follow b before the transaction, doesn’t it have to follow?

if not followed before;  
{

error: “Not Found”,

status: 404,

message: “Follow not found”

}

---

<div class="post-metadata">

**Author:** ![alisahanyalcin](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/alisahanyalcin/32/5854_2.png) [@alisahanyalcin](https://discuss.dev.twitch.com/u/alisahanyalcin)\
**Post date:** [February 23, 2019, 8:59pm UTC](https://discuss.dev.twitch.com/t/twitch-api-how-to-user-follow-and-unfollow/20175/10 "2019-02-23T20:59:05Z")

</div>

I forgot to tag, sorry.

---

<div class="post-metadata">

**Author:** ![alisahanyalcin](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/alisahanyalcin/32/5854_2.png) [@alisahanyalcin](https://discuss.dev.twitch.com/u/alisahanyalcin)\
**Post date:** [February 24, 2019, 9:49am UTC](https://discuss.dev.twitch.com/t/twitch-api-how-to-user-follow-and-unfollow/20175/11 "2019-02-24T09:49:27Z")

</div>

when i use this code is not follow just checking

---

<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:** [February 24, 2019, 10:27am UTC](https://discuss.dev.twitch.com/t/twitch-api-how-to-user-follow-and-unfollow/20175/12 "2019-02-24T10:27:59Z")

</div>

1. There is no need to bump the topic JUST to tag me
2. There is no need to bump the topic at all

If you are performing an attempt to follow and getting

```auto
{

error: “Not Found”,

status: 404,

message: “Follow not found”

}

```

Then you are not doing it right. That’s not a correct response for performing a “create follow”.

Sounds like you are not PUTting, just GETting

As documented

> **[Reference](https://dev.twitch.tv/docs/api/reference/)**
>
> Twitch Developer tools and services to integrate Twitch into your development or create interactive experience on twitch.tv.

Please provide your full code and the responses you are getting

---

<div class="post-metadata">

**Author:** ![alisahanyalcin](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/alisahanyalcin/32/5854_2.png) [@alisahanyalcin](https://discuss.dev.twitch.com/u/alisahanyalcin)\
**Post date:** [February 24, 2019, 1:06pm UTC](https://discuss.dev.twitch.com/t/twitch-api-how-to-user-follow-and-unfollow/20175/13 "2019-02-24T13:06:17Z")

</div>

problem solved thank you 🙂

---

<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 26, 2019, 1:06pm UTC](https://discuss.dev.twitch.com/t/twitch-api-how-to-user-follow-and-unfollow/20175/14 "2019-03-26T13:06:19Z")

</div>

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