With Release 2.1.6 we are introducing a couple of new features to Maker API.
Multiple parameters to device commands
When sending a command to a device via an endpoint, it is now possible to specify multiple parameters for the command. These parameters go in the [Secondary value] field of the endpoint, and are separated by commas. Command parameters can be integer, decimal or string. It's up to you to be sure to use the correct type of parameter.
Example sets a lock code for slot 3, code 4321, named Guest:
http://192.168.1.156/apps/api/3845/devices/1321/setCode/3,4321,Guest?access_token=YOUR_ACCESS_TOKEN
HTTP POST to URL for device events
Instead of polling devices through Maker API to learn of device events, just enter a URL for events to be sent to via an HTTP POST. The body of the POST will contain a JSON object with the device event details:
data = [name: event.name,
value: event.value,
displayName: event.displayName,
deviceId: event.device.id,
descriptionText: event.descriptionText,
unit: event.unit,
data: event.data]
You can enter the URL to use in the Maker API UI, or you can send it to an endpoint. Example below (the endpoint URL to use is displayed in Maker API UI):
http://192.168.1.156/apps/api/3845/postURL/[URL]?access_token=YOUR_ACCESS_TOKEN
Replace [URL] with actual URL to send POST to (URL encoded). Once this URL exists, either from hitting Done after entering it into the UI, or once the URL is sent to the endpoint, Maker API will start sending every device event for the selected devices. There is an option to select that Location events also be sent by Maker API along with device events.
To clear the URL, which stops the event stream, omit the /[URL], like this example:
http://192.168.1.156/apps/api/3845/postURL?access_token=YOUR_ACCESS_TOKEN