Instance Methods
delete
(async) delete(uri): Promise.<any>Perform a DELETE request.
Parameters
Name | Type | Description |
---|---|---|
uri
|
string | The path to request, relative to /api. |
Returns
Promise.<any>
get
(async) get(uri): Promise.<any>Perform a GET request.
Parameters
Name | Type | Description |
---|---|---|
uri
|
string | The path to request, relative to /api. |
Returns
Promise.<any>
getApi
getApi(uri): ApigetApiApp
getApiApp(appId): ApigetLocalUrl
(async) getLocalUrl(): Promise.<string>Returns the url for local access.
Returns
Promise.<string>
getOwnerApiToken
(async) getOwnerApiToken(): Promise.<string>Starts a new API session on behalf of the homey owner and returns the API token. The API Token expires after not being used for two weeks.
Requires the
homey:manager:api
permission. For more information about permissions read the Permissions tutorial.
Returns
Promise.<string>
post
(async) post(uri, body): Promise.<any>Perform a POST request.
Parameters
Name | Type | Description |
---|---|---|
uri
|
string | The path to request, relative to /api. |
body
|
any | The body of the request. |
Returns
Promise.<any>
put
(async) put(uri, body): Promise.<any>Perform a PUT request.
Parameters
Name | Type | Description |
---|---|---|
uri
|
string | The path to request, relative to /api. |
body
|
any | The body of the request. |
Returns
Promise.<any>
realtime
(async) realtime(event, data)Emit a realtime
event.
Parameters
Name | Type | Description |
---|---|---|
event
|
string | The name of the event |
data
|
any | The data of the event |