Jump to content

Recommended Posts

Posted (edited)

Hi, is there a way to execute API based on Emby events  ?

 

lets say a new user register his device in emby. 

Can we make emby execute an API url of my choice ? this api will register on my system that the following  user has registered with XX devices ? 

 

if by default not possible. 

can this be created using a plugin, or the limitation does not allow such plugins ?

 

or is there another better way to keep control of my users ?

 

I just want a email notification or something that can trigger when a new device is registered. 

Edited by nils12
Posted

You could use the api to listen to events using the web socket. You could also do this with A plugin.

  • 1 month later...
nahovevyse
Posted (edited)

You could use the api to listen to events using the web socket. You could also do this with A plugin.

I tried it, connected to the websocket but when the user log in nothing got triggered. Tho EMBY admin dashboard is showing the user's. 

Here's what I tried with python. It's connected but no message afterwards. Where am I wrong. I want the device ID when user's log in.

 

 websocket.enableTrace(True)
    host = "xxx.xx.xx.xx"
    port = 8096
    api_key = "bd404819afb6474e8820b351b8de89b3"
    ws = websocket.WebSocketApp("ws://{}:{}/embywebsocket?api_key={}".format(host, port, api_key),
                                on_message = on_message,
                                on_error = on_error,
                                on_close = on_close) 

Also tried using

 

ws://{}:{}/embywebsocket?api_key={}&deviceId={}".format(host, port, api_key, device_id)

no success

Do I have to send some json first before start receiving the response?

Edited by nahovevyse
Posted

I tried it, connected to the websocket but when the user log in nothing got triggered. Tho EMBY admin dashboard is showing the user's. 

Here's what I tried with python. It's connected but no message afterwards. Where am I wrong. I want the device ID when user's log in.

 

 websocket.enableTrace(True)
    host = "xxx.xx.xx.xx"
    port = 8096
    api_key = "bd404819afb6474e8820b351b8de89b3"
    ws = websocket.WebSocketApp("ws://{}:{}/embywebsocket?api_key={}".format(host, port, api_key),
                                on_message = on_message,
                                on_error = on_error,
                                on_close = on_close) 

Also tried using

 

ws://{}:{}/embywebsocket?api_key={}&deviceId={}".format(host, port, api_key, device_id)

no success

Do I have to send some json first before start receiving the response?

https://emby.media/community/index.php?/topic/71425-getting-user-login-and-device-in-use-via-websocket-api/

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...