Webhooks not working?

So I’ve been trying out webhook, but it doesn’t seem to work.

I’ve basically created a simple Sanic python program (similar to node.js or Flask)

import os
from sanic import Sanic
from sanic.response import text, HTTPResponse
from pprint import pprint

app = Sanic( "PLEX listener" )

@app.route("/", methods=['POST'])
async def handle_plex( request ):
    print( "here" )
    pprint( request.body )
    return text( "hell", status = 200 )

if __name__ == '__main__':
    app.run( host = '0.0.0.0', port = 32401, auto_reload = True, debug = True )

Which basically just try to print out POST request to /. I’ve tested it using curl, and other REST testing tool, and it works. However it doesn’t work on Plex.

I’ve enabled Webhooks on Settings >> Network.
And on Account >> Webhooks, I’ve added

What else do you need to enable? When is webhook triggered? I tried it by playing and stopping music

I forgot to add that the Plex server is running on MacOS Big Sur.

Sorry, deleted my last reply after I re-read your post. I can see you’ve added the correct settings. Playing and stopping a track should definitely fire the relevant events.

Have you got any firewall or similar that might be getting in the way? Is remote access set up and working correctly? If PMS thinks it’s offline, it won’t send the webhooks.

Assuming both of these aren’t issues, try re-registering the webhook by deleting and readding it.

I thought firewall was the issue, but I ran that code on the same machine as the server.

I could still curl -X POST from another machine, and it works.
But somehow when playing / stopping tracks, nothing is triggered.
And I tried those with those 3 endpoints added onto my list of webhooks.

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