New Twitch API - Problems with subscription no POST responses?, no ability to change title?

So, I’m about to write a small chatbot written in python, so far, I can get the my user ID, create a subscription to /helix/channels and I get a 202.

I have a flask server running to handle the callback, I see the hub.challenge and return this (as 200 status).

Example code to subscribe to event the client side:

def subscribe_to_twitch_event():
headers = {‘Authorization’: ‘Bearer {0}’.format(get_twitch_api_token()[‘access_token’])
param_data = {
‘hub.mode’: ‘subscribe’,
#‘hub.topic’: ‘{0}'.format('XXXXX’),
‘hub.topic’: ‘{0}'.format('XXXXX’),
‘hub.callback’: ‘’,
‘hub.lease_seconds’: ‘90’,
‘hub.secret’: ‘SECRET SHHH’,
response =“”, params=param_data, headers=headers, verify=True)

def get_twitch_subscriptions():
headers = {‘Authorization’: ‘Bearer {0}’.format(get_twitch_api_token()[‘access_token’])}

response = requests.get("", headers=headers, verify=True)
print response.json()

I see:

From the initial subscription: <Response [202]>

From the check of subscription: {u’pagination’: {}, u’total’: 1, u’data’: [{u’topic’: u’’, u’callback’: u’’, u’expires_at’: u’2018-10-24T07:27:03Z’}]}

Looks good

On the Callback side twitch is sending: - - [24/Oct/2018 03:25:50] “GET /1.0/foobar/twitch/callback?hub.challenge=-MVIY_JIdhwLhG4icinviIMWz8gsG3pRogqIDmjg&hub.lease_seconds=90&hub.mode=subscribe& HTTP/1.1” 200 -

In the GET for /1.0/foobar/twitch/callback I return the hub.challenge value the API returns 200 for http status.

When I go online, change title of stream with Streamlabs OBS, I am not getting callbacks to the POST for /1.0/foobar/twitch/callback. Doesn’t seem to be telling me there’s a response coming back.

@app.route(‘/1.0/foobar/twitch/callback’, methods=[‘GET’, ‘POST’])
def _twitch_callback():
if request.method == ‘GET’:
challenge = request.args.get(‘hub.challenge’)
print(“Challenge is: {0}”.format(challenge))
return challenge
print(“GOT A POST CALL!!!”)

Whats wrong?

I also don’t see any API method to let me change the stream channel title, or any way to get the stream/channel ID to change the title with the Helix API or this isn’t implemented yet?


Thats not currently in helix

As per

You can get a user by username/login or ID, which’ll return both keys

You set the webhook like time to 90 seconds.

Your hook is expiring before you go live/change your title.

You ca set a maximum of 10 days. Try setting it to something longer than 90 seconds.

I’ll try a longer lease, but the code looks right to you?

I’ll have to use the v5 API then for things not implemented though, I wonder if the deadline for December might be pushed further back.

It already has been. Theres no longer an official end date for v5.

Yup, as your Challenge is working for you so should be all good for receiving notifications.

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