Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webhook API #516

Closed
wants to merge 5 commits into from
Closed

Webhook API #516

wants to merge 5 commits into from

Conversation

danfai
Copy link
Contributor

@danfai danfai commented Mar 8, 2022

This PR adds a Webhook API to syncplay.
For example you can have a rocket-chat server, with channels that put every posted link in a channel in syncplay.
The API also works with persistent rooms and if somebody is in the channel it will post as someone randomly, since there is no user/watcher assigned to the API.
Note that currently this API does not allow reading the current playlist but only appending.

Example configuration for Outgoing WebHook integration in rocketchat:
URLs: http:// SYNCPLAY_SERVER : WEBHOOK_PORT
Script:

class Script {
  prepare_outgoing_request({ request }) {
    url = request.data.text;
    c = request.data.channel_name;
    request.data = {"text": text, "channel_name": c};
    return request;
    }
  }
​
  /**
   * @params {object} request, response
   */
  process_outgoing_response({ request, response }) {
    return;
  }
}

I am happy to hear your feedback and improve the PR if necessary.

@Et0h
Copy link
Contributor

Et0h commented Apr 6, 2022

Hi, this an interesting concept so thanks for sharing it. It looks like it'd need some work to get it to be merge-ready and then there is the question of whether we want to add this level of additional complexity to the software.

As noted in the principles set out at #315 we have to balance increasing functionality with keeping things as simple as possible to minimise bugs and make the software easier to maintain.

I'm not sure how many people would want every URL posted in their chat server to be added to a Syncplay playlist and webhooks isn't really an area I have that much familiarity with to be able to properly maintain and test the code. I'd be interested to hear from others what their thoughts are and whether or not it provides a feature which they would be likely to use.

@dmgolembiowski
Copy link

dmgolembiowski commented Oct 17, 2022

Hi, this an interesting concept so thanks for sharing it. It looks like it'd need some work to get it to be merge-ready and then there is the question of whether we want to add this level of additional complexity to the software.

As noted in the principles set out at #315 we have to balance increasing functionality with keeping things as simple as possible to minimise bugs and make the software easier to maintain.

I'm not sure how many people would want every URL posted in their chat server to be added to a Syncplay playlist and webhooks isn't really an area I have that much familiarity with to be able to properly maintain and test the code. I'd be interested to hear from others what their thoughts are and whether or not it provides a feature which they would be likely to use.

A webhook API seems to bring a lot of value here, but it might be better to move the webhook server out into its own package.

Update: A web API would make this experience incredible.

@albertosottile albertosottile added enhancement stale Marked for deletion labels Dec 22, 2022
@Et0h
Copy link
Contributor

Et0h commented Dec 25, 2022

I'm closing this as we have no plans to support a Webhook API at present.

@Et0h Et0h closed this Dec 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement stale Marked for deletion
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants