Api

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

Methods

delete

delete(uri): Promise.<any>

Perform a DELETE request.

Parameters

Name Type Description
uri
string

The path to request, relative to the endpoint.

Returns

Promise.<any>

get

get(uri): Promise.<any>

Perform a GET request.

Parameters

Name Type Description
uri
string

The path to request, relative to the endpoint.

Returns

Promise.<any>

post

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

Promise.<any>

put

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

Promise.<any>

unregister

unregister()

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