From 86cf0277496a5ad22195ad1721a89e364fd61f54 Mon Sep 17 00:00:00 2001 From: Chris Caron Date: Fri, 12 May 2023 22:19:06 -0400 Subject: [PATCH] Updated Notify_signal (markdown) --- Notify_signal.md | 61 +++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 52 insertions(+), 9 deletions(-) diff --git a/Notify_signal.md b/Notify_signal.md index 87152ce..ba4a1fe 100644 --- a/Notify_signal.md +++ b/Notify_signal.md @@ -30,12 +30,12 @@ The **{FromPhoneNo}** must be the number associated with your account. Valid syntax is as follows: * `signal://{user}:{password}@{hostname}/{from_phone}` * `signal://{user}:{password}@{hostname}:{port}/{from_phone}` -* `signal://{user}:{password}@{hostname}/{from_phone}/{to_phone}` -* `signal://{user}:{password}@{hostname}:{port}/{from_phone}/{from_phone}` +* `signal://{user}:{password}@{hostname}/{from_phone}/{target}` +* `signal://{user}:{password}@{hostname}:{port}/{from_phone}/{target}` You can post in multiple chats by simply chaining them at the end of the URL. -* `signal://{user}:{password}@{hostname}:{port}/{from_phone}/{to_phone1}/{to_phone2}/{to_phone3}` -* `signals://{user}:{password}@{hostname}:{port}/{from_phone}/{to_phone1}/{to_phone2}/{to_phone3}` +* `signal://{user}:{password}@{hostname}:{port}/{from_phone}/{target1}/{target2}/{target3}` +* `signals://{user}:{password}@{hostname}:{port}/{from_phone}/{target1}/{target2}/{target3}` ### Parameter Breakdown | Variable | Required | Description @@ -45,11 +45,43 @@ You can post in multiple chats by simply chaining them at the end of the URL. | user | No | If you're system is set up to use HTTP-AUTH, you can provide _username_ for authentication to it. | password | No | If you're system is set up to use HTTP-AUTH, you can provide _password_ for authentication to it. | from | Yes | This must be a _From Phone Number_ you've added to the API service. -| to | **\*No** | A phone number you wish to send your notification to. If one isn't specified, then the `from` is used instead. +| to | **\*No** |A phone number or group id you wish to send your notification to. If one isn't specified, then the `from` is used instead. | batch | No | Send multiple specified notifications in a single batch (1 upstream post to the end server). By default this is set to `no`. | status | No | Optionally include a small little ASCII string representing the notification status being sent (inline with it) by default this is set to `no`. -#### Example +### Acquiring A Group ID +Groups can be created in the app, or via the [Signal Rest API Service](https://github.com/bbernhard/signal-cli-rest-api). +To get a list of available groups and their ids run: +```bash +curl -X GET -H "Content-Type: application/json" localhost:9922/v1/groups/+15555551234 | jq +``` + +Example output is as follows: +``` +[ + { + "name": "Test Group", + "id": "group.abcdefghijklmnop=", + "internal_id": "aabbccdd/eeffgghh=", + "members": [ + "+1555555551234 + "+16666661234" + ], + "blocked": false, + "pending_invites": [], + "pending_requests": [], + "invite_link": "", + "admins": [ + "+1555555551234" + ] + } +] + +The takeaway from the above is the group +``` +Example sending a notification to a group: `group.aabbccdd/eeffgghh=` identified by the `id`. + +### Example Send a Signal Notification (via Signal API): ```bash # Assuming our {Hostname} is localhost (hosting the bbernhard/signal-cli-rest-api) @@ -57,12 +89,12 @@ Send a Signal Notification (via Signal API): # Assuming our {PhoneNo} - is in the US somewhere making our country code +1 # - identifies as 800-555-1223 apprise -vv -t "Test Message Title" -b "Test Message Body" \ - signal://localhost/19005559999/18005551223 + "signal://localhost/19005559999/18005551223" # the following would also have worked (spaces, brackets, # dashes are accepted in a phone no field): apprise -vv -t "Test Message Title" -b "Test Message Body" \ - signal://localhost/1-(900) 555-9999/1-(800) 555-1223 + "signal://localhost/1-(900) 555-9999/1-(800) 555-1223" ``` Based on my personal experiences, I was able to send a notification to myself by simply doing the following: @@ -71,9 +103,20 @@ Based on my personal experiences, I was able to send a notification to myself by # Assuming our {Port} is 9922 # Assuming our {FromPhoneNo} is +1 555 555 1234 apprise -vv -t "Test Message Title" -b "Test Message Body" \ - signal://localhost:9922/15555551234 + "signal://localhost:9922/15555551234" ``` +If you know the Group ID you want to notify, you can idenify it as well on the command line: +```bash +# Assuming our {Hostname} is localhost (hosting the bbernhard/signal-cli-rest-api) +# Assuming our {Port} is 9922 +# Assuming our {FromPhoneNo} is +1 555 555 1234 +# Assuming our {Group} is group.abcdefghijklmnop= +apprise -vv -t "Group Message:" -b "Hello group members" \ + "signal://localhost:9922/+1555555551234/group.abcdefghijklmnop=" +``` + + I could even send an attachment without a problem: ```bash apprise -vv -t -b "test" \