From 70964339a108bfabdae7eaa15c4bf1f0cceaa094 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sat, 12 Jan 2019 11:51:57 +1300 Subject: [PATCH] Added instructions on where to get a token for the REST api (#164) * Added instructions on where to get a token for the REST api * Update external_api_rest.md --- docs/external_api_rest.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/docs/external_api_rest.md b/docs/external_api_rest.md index 54a7022d..ddf48457 100644 --- a/docs/external_api_rest.md +++ b/docs/external_api_rest.md @@ -2,15 +2,17 @@ title: "REST API" --- -Home Assistant runs a web server accessible on port 8123. - -* http://IP_ADDRESS:8123/ is an interface to control Home Assistant. -* http://IP_ADDRESS:8123/api/ is a Rest API. - -The API accepts and returns only JSON encoded objects. All API calls have to be accompanied by the header `Authorization: Bearer ABCDEFGH`. +Home Assistant provides a RESTful API on the same port as the web frontend. (default port is port 8123). If you are not using the [`frontend`](https://www.home-assistant.io/components/frontend/) in your setup then you need to add the [`api` component](https://www.home-assistant.io/components/api/) to your `configuration.yaml` file. +* http://IP_ADDRESS:8123/ is an interface to control Home Assistant. +* http://IP_ADDRESS:8123/api/ is a RESTful API. + +The API accepts and returns only JSON encoded objects. + +All API calls have to be accompanied by the header `Authorization: Bearer ABCDEFGH`. You can obtain a token ("Long-Lived Access Token") by logging into the frontend using a web browser, and going to your profile `http://IP_ADDRESS:8123/profile`. + There are multiple ways to consume the Home Assistant Rest API. One is with `curl`: ```bash