diff --git a/source/developers/rest_api.markdown b/source/developers/rest_api.markdown index 27b4392e1a7..2394857ebf9 100644 --- a/source/developers/rest_api.markdown +++ b/source/developers/rest_api.markdown @@ -413,7 +413,9 @@ Returns a list of states that have changed while the service was being executed. ] ``` -Sample `curl` command: +Sample `curl` commands: + +Turn the light on: ```bash $ curl -X POST -H "x-ha-access: YOUR_PASSWORD" \ @@ -422,6 +424,16 @@ $ curl -X POST -H "x-ha-access: YOUR_PASSWORD" \ http://localhost:8123/api/services/switch/turn_on ``` +Send a MQTT message: + +```bash +$ curl -X POST \ + -H "Content-Type: application/json" \ + -H "x-ha-access:YOUR_PASSWORD" \ + -d '{"payload": "OFF", "topic": "home/fridge", "retain": "True"}' \ + http://localhost:8123/api/services/mqtt/publish +``` +

The result will include any states that changed while the service was being executed, even if their change was the result of something else happening in the system.