Skip to content

Webhook

rblxopencloud.Webhook(secret=None, api_key=None)

Represents a Roblox outgoing webhook. It is used to validate and process webhook events.

Parameters:

Name Type Description Default
secret Optional[Union[str, bytes]]

Random letters only known by Roblox and the server to validate requests.

None
api_key str

Your API key created from Creator Dashboard with access to all objects that are generated in events.

None

process_notification(body, secret_header=None, validate_signature=True)

Processes a HTTP webhook event and returns a response text and status code tuple. Example for Flask:

    @app.route('/webhook-roblox', methods=["POST"])
    def webhook_roblox():
        return webhook.process_notification(
            body=request.data,
            secret_header=request.headers["Roblox-Signature"]
        )

Parameters:

Name Type Description Default
body bytes

The HTTP raw body.

required
secret_header bytes

The raw value of the Roblox-Signature header.

None
validate_signature bool

whether to validate the signature or not. This should not be disabled in production.

True

event(func)

Register event callbacks with this decorator. The allowed function names, and the notification type they return is as follows:

Event Name Notification Type Event Description
on_test TestNotification Triggers when the user clicks 'Test Response' on the Webhook configuration page
on_right_to_erasure_request RightToErasureRequestNotification Triggers when a right to erause request is recieved.

rblxopencloud.Notification

Represents a recieved base webhook event.

Warning

This class isn't designed to be created by users. It is returned by some decorated functions from Webhook.event().

Attributes: notification_id: The notifications unique ID. If an ID is repeated, assume it is a duplicate and ignore it. timestamp: The time the notification was created. webhook: The webhook that the notifcation came from.

rblxopencloud.TestNotification

Bases: Notification

Represents a recieved webhook event triggered by the user pressing 'Test Response' on the webhook configuration page.

Attributes:

Name Type Description
user User

The user who triggered the test.

rblxopencloud.RightToErasureRequestNotification

Bases: Notification

Represents a recieved webhook event triggered by a user requesting Roblox to erase all their user data.