From 78df7d3abc8eadbab45b2e9b297b01dc55fb6d87 Mon Sep 17 00:00:00 2001 From: "D. Domig" Date: Sat, 16 Jan 2021 17:44:34 +0100 Subject: [PATCH] Fix markdownlint issues --- README.md | 7 +++--- doc/EXAMPLES.md | 4 +--- doc/HOMEASSISTANT.md | 51 +++++++++++++++++++++--------------------- doc/OCTOPRINT.md | 21 +++++++++-------- doc/TROUBLESHOOTING.md | 2 +- 5 files changed, 41 insertions(+), 44 deletions(-) diff --git a/README.md b/README.md index 8b7f193..5112c2a 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ At the moment, the following functionality is exposed via REST: - Send message (+ attachments) to multiple recipients (or a group) - Receive messages - Link devices -- Create/Liste/Remove groups +- Create/List/Remove groups - List/Serve/Delete attachments - Update profile @@ -17,7 +17,7 @@ At the moment, the following functionality is exposed via REST: Sample `docker-compose.yml`file: -``` +```sh version: "3" services: signal-cli-rest-api: @@ -31,5 +31,4 @@ services: The Swagger API documentation can be found [here](https://bbernhard.github.io/signal-cli-rest-api/). If you prefer a simple text file like API documentation have a look [here](https://github.com/bbernhard/signal-cli-rest-api/blob/master/doc/EXAMPLES.md) - -In case you need more functionality, please **file a ticket** or **create a PR** +In case you need more functionality, please **file a ticket** or **create a PR**. diff --git a/doc/EXAMPLES.md b/doc/EXAMPLES.md index f4cce4c..4c8668b 100644 --- a/doc/EXAMPLES.md +++ b/doc/EXAMPLES.md @@ -1,5 +1,5 @@ -# Sample REST API calls: +# Sample REST API calls - Register a number (with SMS verification) @@ -99,6 +99,4 @@ e.g: The following REST API endpoints are **deprecated and no longer maintained!** - `/v1/send` - diff --git a/doc/HOMEASSISTANT.md b/doc/HOMEASSISTANT.md index 61021b2..d889e65 100644 --- a/doc/HOMEASSISTANT.md +++ b/doc/HOMEASSISTANT.md @@ -1,20 +1,22 @@ # README -This document describes how to use the Signal Messenger REST API together with Home Assistant. +This document describes how to use the Signal Messenger REST API together with Home Assistant. prerequisites: + * docker + docker-compose -or- + * ability to install Home Assistant add-ons * a phone number to send signal notifications ## Set up the docker container -* Create a `docker-compose.yml` file with the following contents: +* Create a `docker-compose.yml` file with the following contents: -``` +```sh version: "3" services: signal-cli-rest-api: @@ -31,42 +33,40 @@ services: Add this repository to your Home Assistant Add-on Store reposity list: -https://github.com/haberda/hassio_addons +[https://github.com/haberda/hassio_addons](https://github.com/haberda/hassio_addons) Then install and start the add-on. ## Register phone number -In order to send signal messages to other users, you first need to register your phone number. This can be done via REST requests with: +In order to send signal messages to other users, you first need to register your phone number. This can be done via REST requests with: - -```curl -X POST -H "Content-Type: application/json" 'http://:/v1/register/'``` - -e.g: - -This registers the number `+431212131491291` to the Signal network. - -```curl -X POST -H "Content-Type: application/json" 'http://127.0.0.1:8080/v1/register/+431212131491291'``` - -After you've sent the registration request, you will receive a token via SMS for verfication. In order to complete the registration process you need to send the verification token back via the following REST request: - -```curl -X POST -H "Content-Type: application/json" 'http://:/v1/register//verify/'``` +`curl -X POST -H "Content-Type: application/json" 'http://:/v1/register/'` e.g: -```curl -X POST -H "Content-Type: application/json" 'http://127.0.0.1:8080/v1/register/+431212131491291/verify/123-456'``` +This registers the number `+431212131491291` to the Signal network. +`curl -X POST -H "Content-Type: application/json" 'http://127.0.0.1:8080/v1/register/+431212131491291'` + +After you've sent the registration request, you will receive a token via SMS for verfication. In order to complete the registration process you need to send the verification token back via the following REST request: + +`curl -X POST -H "Content-Type: application/json" 'http://:/v1/register//verify/'` + +e.g: + +`curl -X POST -H "Content-Type: application/json" 'http://127.0.0.1:8080/v1/register/+431212131491291/verify/123-456'` ## Sending messages to Signal Messenger groups The `signal-cli-rest-api` docker container is also capable of sending messages to a Signal Messenger group. -Requirements: +Requirements: - * Home Assistant Version >= 0.110 - * signal-cli-rest-api build-nr >= 2 - The build number can be checked with: `curl -X GET -H "Content-Type: application/json" 'http://127.0.0.1:8080/v1/about'` - * your phone number needs to be properly registered (see the "Register phone number" section above on how to do that) +* Home Assistant Version >= 0.110 +* signal-cli-rest-api build-nr >= 2 + The build number can be checked with: `curl -X GET -H "Content-Type: application/json" 'http://127.0.0.1:8080/v1/about'` +* your phone number needs to be properly registered (see the "Register phone number" section above on how to do that) A new Signal Messenger group can be created with the following REST API request: @@ -78,11 +78,12 @@ This creates a new Signal Messenger group called `my group` with the members `+4 ```curl -X POST -H "Content-Type: application/json" -d '{"name": "my group", "members": ["+4354546464654", "+4912812812121"]}' 'http://127.0.0.1:8080/v1/groups/+431212131491291'``` -Next, use the following endpoint to obtain the group id: +Next, use the following endpoint to obtain the group id: ```curl -X GET -H "Content-Type: application/json" 'http://127.0.0.1:8080/v1/groups/'``` The group id then needs to be added to the Signal Messenger's `recipients` list in the `configuration.yaml`. (see [here](https://www.home-assistant.io/integrations/signal_messenger/) for details) -# Troubleshooting +## Troubleshooting + In case you've problems with the `signal-cli-rest-api` container, have a look [here](TROUBLESHOOTING.md) diff --git a/doc/OCTOPRINT.md b/doc/OCTOPRINT.md index c86c0ce..5743c36 100644 --- a/doc/OCTOPRINT.md +++ b/doc/OCTOPRINT.md @@ -1,16 +1,17 @@ # README -This document describes how to use the Signal Messenger REST API together with Octoprint. +This document describes how to use the Signal Messenger REST API together with Octoprint. prerequisites: + * docker + docker-compose * a phone number to send signal notifications ## Set up the docker container -* Create a `docker-compose.yml` file with the following contents: +* Create a `docker-compose.yml` file with the following contents: -``` +```sh version: "3" services: signal-cli-rest-api: @@ -23,21 +24,19 @@ services: * start the docker container with `docker-compose up` - ## Register phone number -In order to send signal messages to other users, you first need to register your phone number. This can be done via REST requests with: +In order to send signal messages to other users, you first need to register your phone number. This can be done via REST requests with: +`curl -X POST -H "Content-Type: application/json" 'http://:/v1/register/'` -```curl -X POST -H "Content-Type: application/json" 'http://:/v1/register/'``` - -e.g: +e.g: This registers the number `+431212131491291` to the Signal network. -```curl -X POST -H "Content-Type: application/json" 'http://127.0.0.1:8080/v1/register/+431212131491291'``` +`curl -X POST -H "Content-Type: application/json" 'http://127.0.0.1:8080/v1/register/+431212131491291'` -After you've sent the registration request, you will receive a token via SMS for verfication. In order to complete the registration process you need to send the verification token back via the following REST request: +After you've sent the registration request, you will receive a token via SMS for verfication. In order to complete the registration process you need to send the verification token back via the following REST request: ```curl -X POST -H "Content-Type: application/json" 'http://:/v1/register//verify/'``` @@ -45,6 +44,6 @@ e.g: ```curl -X POST -H "Content-Type: application/json" 'http://127.0.0.1:8080/v1/register/+431212131491291/verify/123-456'``` +## Troubleshooting -# Troubleshooting In case you've problems with the `signal-cli-rest-api` container, have a look [here](TROUBLESHOOTING.md) diff --git a/doc/TROUBLESHOOTING.md b/doc/TROUBLESHOOTING.md index 05f1959..f4aef0c 100644 --- a/doc/TROUBLESHOOTING.md +++ b/doc/TROUBLESHOOTING.md @@ -1,3 +1,3 @@ -## The signal-cli-rest-api docker container won't start (signal_messenger_signal-cli-rest-api_1 exited with code 0) +# The signal-cli-rest-api docker container won't start (signal_messenger_signal-cli-rest-api_1 exited with code 0) If your docker container stops with `signal_messenger_signal-cli-rest-api_1 exited with code 0`, make sure that the host port isn't already occupied by another process (see [here](https://github.com/bbernhard/signal-cli-rest-api/issues/2)).