API expansion: run script on demand from API call

b0bbybacc asked for this feature almost 3 years ago — 2 comments

b0bbybacc commented almost 3 years ago

I wrote a script that pulls information from the PlexPy API and that is all wired up.

The rest of my plan was to create a Slack command (for Outbound Webhook integration) but after looking through the api documentation there is really nothing I can use in the API to force this script to run on demand from the PlexPy api.

There is probably a way that I can wire up some other web listener application to listen for the slack outbound hook which would then kickoff the specific script (and if anyone knows something that is lightweight and rock-solid for that let me know).

It would be nice to have an API endpoint for running a script stored in the scripts directory:

http://ip:port + HTTPROOT + /api/v2?apikey=$apikey&cmd=$runscript&path=x$args=y

So from slack you could do

!custom_command $arg and send it through the outbound webhook to the plexpy api which then runs the script with any arguments based on what was pass from the slack instance.

or something like that.

JonnyWong16 commented almost 3 years ago Admin

Possible with the notify api command.

Params: apikey: APIKEY cmd: notify agentid: 15 script: '/path/to/script/file.py' scriptargs: 'argv1 argv2 argv3'

Join the discussion!

with GitHub to comment