You are currently viewing the Homey Apps SDK v2 documentation. New apps should use Homey Apps SDK v3 ››

Homey.CloudWebhook

const { CloudWebhook } = require('homey');

A webhook class that can receive incoming messages

Table of Contents

Constructor

new Homey.CloudWebhook(id, secret, data)

Parameters:
Name Type Description
id string

Webhook ID

secret string

Webhook Secret

data Object

Webhook Data

Methods

register(callbackopt) → {Promise}

Register the webhook. This is a shortcut for ManagerCloud#registerWebhook

Parameters:
Name Type Attributes Description
callback genericCallbackFunction <optional>
Returns:
Type:
Promise

unregister(callbackopt) → {Promise}

Unregister the webhook. This is a shortcut for ManagerCloud#unregisterWebhook

Parameters:
Name Type Attributes Description
callback genericCallbackFunction <optional>
Returns:
Type:
Promise

Events

.on('message')

This event is fired when a webhook message has been received.

Parameters:
Name Type Description
args Object
Name Type Description
headers Object

Received HTTP headers

query Object

Received HTTP query string

body Object

Received HTTP body