Api

This class represents an API endpoint on Homey. When registered, realtime events are fired on the instance.

Table of Contents

Methods

delete(uri) → {Promise.<any>}

Perform a DELETE request.

Parameters:
Name Type Description
uri string

The path to request, relative to the endpoint.

Returns:
Type:
Promise.<any>

get(uri) → {Promise.<any>}

Perform a GET request.

Parameters:
Name Type Description
uri string

The path to request, relative to the endpoint.

Returns:
Type:
Promise.<any>

post(uri, body) → {Promise.<any>}

Perform a POST request.

Parameters:
Name Type Description
uri string

The path to request, relative to the endpoint.

body any

The body of the request.

Returns:
Type:
Promise.<any>

put(uri, body) → {Promise.<any>}

Perform a PUT request.

Parameters:
Name Type Description
uri string

The path to request, relative to the endpoint.

body any

The body of the request.

Returns:
Type:
Promise.<any>

unregister()

Unregister the API. This is a shorthand method for ManagerApi#unregisterApi.