Executing external scripts on Channel events/actions.
support, ws.webtv, clips, developers, scripts, webhooks, callbacks
Since WS.WebTV 2.2.0.2 it is possible to call external scripts on certain Channel events/actions.
How does it works?
If you specify the URLs of the scripts in the WebTV configuration file (config/Config.inc.php), the system will call those scripts when certain User events/actions occur.
This functionality can be complemented with the API extension. For example,
if you are integrating the WebTV with an external system, you can use these script calls (and the API) to synchronize both system.
This script is called when a Channel is created (either from the back-end or through the API).
Data sent by the WebTV as POST variables:
• id (int): The Channel ID.
• type (int): The type of Channel. Possible values: 0 = Video, 1 = Page, 2 = Portal.
• id_user (int): The ID of the User (Author/Owner)
Variable in configuration File:
$CHANNEL_ON_CREATE_SCRIPT_URL = ""; // Must be an absolute URL, starting with http:// or https://
This script is called when a Channel changes its status. For example, it will be called when a Channel has been activated/deactivated. Note that this script won't be called when the status of a Channel have changed after being modified/edited, in this case the "on change" script will be called.
Data sent by the WebTV as POST variables:
• id (int): The Channel ID.
• status (int): The Channel Status. Possible values: 0=Inactive, 1=Active.
Variable in configuration File:
$CHANNEL_ON_STATUS_CHANGE_SCRIPT_URL = ""; // Must be an absolute URL, starting with http:// or https://
This script is called when a Channel is modified/edited.
Data sent by the WebTV as POST variables:
• id (int): The Channel ID.
Variable in configuration File:
$CHANNEL_ON_CHANGE_SCRIPT_URL = ""; // Must be an absolute URL, starting with http:// or https://
This script is called when a Channel is deleted.
Data sent by the WebTV as POST variables:
• id (int): The Channel ID.
Variable in configuration File:
$CHANNEL_ON_DELETE_SCRIPT_URL = ""; // Must be an absolute URL, starting with http:// or https://
(Since WS.WebTV v57pf) This script is called just before a Channel is deleted.
Data sent by the WebTV as POST variables:
• id (int): The Channel ID.
Variable in configuration File:
$CHANNEL_ON_BEFORE_DELETE_SCRIPT_URL = ""; // Must be an absolute URL, starting with http:// or https://
Your gateway to decentralized finance: MetaMask Extension. Simplify crypto management now.