Constructor
new Homey.Api(uri)
Parameters:
Name | Type | Description |
---|---|---|
uri |
string
|
The URI of the endpoint, e.g. |
Methods
delete(path, callbackopt)
Perform a DELETE request.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
path |
string
|
The path of the request, relative to the endpoint. |
|
callback |
genericCallbackFunction
|
<optional> |
Returns:
Promise
get(path, callbackopt)
Perform a GET request.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
path |
string
|
The path of the request, relative to the endpoint. |
|
callback |
genericCallbackFunction
|
<optional> |
Returns:
Promise
post(path, body, callbackopt)
Perform a POST request.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
path |
string
|
The path of the request, relative to the endpoint. |
|
body |
*
|
The body of the request. |
|
callback |
genericCallbackFunction
|
<optional> |
Returns:
Promise
put(path, body, callbackopt)
Perform a PUT request.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
path |
string
|
The path of the request, relative to the endpoint. |
|
body |
*
|
The body of the request. |
|
callback |
genericCallbackFunction
|
<optional> |
Returns:
Promise
register() → {Api}
Register the API, to receive incoming realtime events. This is a shorthand method for ManagerApi#registerApi.
Returns:
- Type:
-
Api