# Provided hub.topic doesn't work

**URL:** <https://discuss.dev.twitch.com/t/provided-hub-topic-doesnt-work/26828>\
**Category:** API\
**Created:** [June 29, 2020, 9:47pm UTC](https://discuss.dev.twitch.com/t/provided-hub-topic-doesnt-work/26828 "2020-06-29T21:47:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![schelcc](https://avatars.discourse-cdn.com/v4/letter/s/e99b99/32.png) [@schelcc](https://discuss.dev.twitch.com/u/schelcc)\
**Post date:** [June 29, 2020, 9:47pm UTC](https://discuss.dev.twitch.com/t/provided-hub-topic-doesnt-work/26828/1 "2020-06-29T21:47:55Z")

</div>

So at the moment, I’m trying to figure out what in the world I’m doing so I can eventually write better code for this, so forgive me if it’s a mess.

(All python btw)

I’m trying to subscribe to follow events from user\_id 51375532 so I’m using the endpoint  
`api_endpnt = "https://api.twitch.tv/helix/webhooks/hub?hub.callback=mycallback&hub.mode=subscribe&hub.lease_seconds=600&hub.topic=https://api.twitch.tv/helix/users/follows?first=1&to_id=51375532"`

(The callback is fine on my end I just didn’t know if that’s something I should censor)

```
head = {
'Client-ID': 'myid',
"Authorization": "mytoken"

```

}

And then I’m eventually making the request with`r = requests.post(url=api_endpnt, headers=head)`

But then I get a hub.topic unsupported topic. The only thing not copied and pasted in hub.topic is my id. I’m assuming this has to do with the way the endpoint is being parsed because other ones work (like subscribing to a channels updates) but since there’s an ampersand it’s having problems?

Sorry again if this is a mess I’m new and have looked around for an answer to this for 2 hours now. Thanks!

---

<div class="post-metadata">

**Author:** ![Dist](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/dist/32/7192_2.png) [@Dist](https://discuss.dev.twitch.com/u/Dist)\
**Post date:** [June 29, 2020, 10:07pm UTC](https://discuss.dev.twitch.com/t/provided-hub-topic-doesnt-work/26828/2 "2020-06-29T22:07:48Z")

</div>

You’re sending the webhook parameters wrong, they should be sent as JSON in the request body, not in the querystring.

[https://dev.twitch.tv/docs/api/webhooks-reference](https://dev.twitch.tv/docs/api/webhooks-reference)

---

<div class="post-metadata">

**Author:** ![schelcc](https://avatars.discourse-cdn.com/v4/letter/s/e99b99/32.png) [@schelcc](https://discuss.dev.twitch.com/u/schelcc)\
**Post date:** [June 29, 2020, 10:21pm UTC](https://discuss.dev.twitch.com/t/provided-hub-topic-doesnt-work/26828/3 "2020-06-29T22:21:21Z")

</div>

Thank you so much! I did

```
    data_raw = {
        "hub.callback" : "mycallback",
        "hub.mode" : "subscribe",
        "hub.lease_seconds" : "600",
        "hub.topic" : "https://api.twitch.tv/helix/users/follows?first=1&to_id=549320051"
    }

```

and it finally worked! I didn’t know I was supposed to be using JSON this whole time. Thanks!

Edit: For other python users submit the request using  
`r = requests.post(url=api_endpnt, data=data_raw, headers=head)`

---

<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:** [July 29, 2020, 10:21pm UTC](https://discuss.dev.twitch.com/t/provided-hub-topic-doesnt-work/26828/4 "2020-07-29T22:21:22Z")

</div>

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