Replace password with bearer token

This commit is contained in:
Fabian Affolter 2018-12-30 22:32:09 +01:00
parent b7313952aa
commit 11906a5530
No known key found for this signature in database
GPG Key ID: E23CD2DD36A4397F

View File

@ -38,10 +38,11 @@ The same will work for automations.
Using the [REST API](https://developers.home-assistant.io/docs/en/external_api_rest.html) to send a message to a given topic. Using the [REST API](https://developers.home-assistant.io/docs/en/external_api_rest.html) to send a message to a given topic.
```bash ```bash
$ curl -X POST -H "x-ha-access: YOUR_PASSWORD" \ $ curl -X POST \
-H "Content-Type: application/json" \ -H "Authorization: Bearer ABCDEFGH" \
-d '{"payload": "Test message from HA", "topic": "home/notification"}' \ -H "Content-Type: application/json" \
http://IP_ADDRESS:8123/api/services/mqtt/publish -d '{"payload": "Test message from HA", "topic": "home/notification"}' \
http://IP_ADDRESS:8123/api/services/mqtt/publish
``` ```
### {% linkable_title Automations %} ### {% linkable_title Automations %}