Signal API Notifications
Ce contenu n’est pas encore disponible dans votre langue.
Signal API
Section titled “Signal API”Account Setup
Section titled “Account Setup”First of all you need a Signal account. So it is presumed you’ve either got the Apple or Android version of the Signal software.
From here, the plugin assumes you have configured yourself up with the Signal Rest API Service.
A simple setup might be:
# Create a directory for our configuration to get stored intomkdir -p $HOME/.signal-api
# Launch a Signal API instance that listens on port 9922docker run -d --name signal-api --restart=always -p 9922:8080 \ -v $HOME/.signal-api:/home/.local/share/signal-cli \ -e 'MODE=native' -e SIGNAL_CLI_UID=$(id -u) -e SIGNAL_CLI_GID=$(id -g) \ bbernhard/signal-cli-rest-apiIf all goes well, you should be able to point your browser to: http://localhost:9922/v1/qrcodelink?device_name=signal-api and from your phone app, follow the instructions to add a Linked Device.
The {FromPhoneNo} must be the number associated with your account.
Syntax
Section titled “Syntax”Valid syntax is as follows:
signal://{user}:{password}@{hostname}/{from_phone}signal://{user}:{password}@{hostname}:{port}/{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}/{target1}/{target2}/{target3}signals://{user}:{password}@{hostname}:{port}/{from_phone}/{target1}/{target2}/{target3}
Parameter Breakdown
Section titled “Parameter Breakdown”| Variable | Required | Description |
|---|---|---|
| hostname | Yes | The Web Server’s hostname |
| port | No | The port our Web server is listening on. By default the port is 80 for signal:// and 443 for all singals:// references. |
| 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 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 yes. |
Global Parameters
Section titled “Global Parameters”| Variable | Description |
|---|---|
| overflow | This parameter can be set to either split, truncate, or upstream. This determines how Apprise delivers the message you pass it. By default this is set to upstream 👉 upstream: Do nothing at all; pass the message exactly as you received it to the service.👉 truncate: Ensure that the message will fit within the service’s documented upstream message limit. If more information was passed then the defined limit, the overhead information is truncated.👉 split: similar to truncate except if the message doesn’t fit within the service’s documented upstream message limit, it is split into smaller chunks and they are all delivered sequentially there-after. |
| format | This parameter can be set to either text, html, or markdown. Some services support the ability to post content by several different means. The default of this varies (it can be one of the 3 mentioned at any time depending on which service you choose). You can optionally force this setting to stray from the defaults if you wish. If the service doesn’t support different types of transmission formats, then this field is ignored. |
| verify | External requests made to secure locations (such as through the use of https) will have certificates associated with them. By default, Apprise will verify that these certificates are valid; if they are not then no notification will be sent to the source. In some occasions, a user might not have a certificate authority to verify the key against or they trust the source; in this case you will want to set this flag to no. By default it is set to yes. |
| cto | This stands for Socket Connect Timeout. This is the number of seconds Requests will wait for your client to establish a connection to a remote machine (corresponding to the connect()) call on the socket. The default value is 4.0 seconds. |
| rto | This stands for Socket Read Timeout. This is the number of seconds the client will wait for the server to send a response. The default value is 4.0 seconds. |
| emojis | Enable Emoji support (such as providing :+1: would translate to 👍). By default this is set to no. Note: Depending on server side settings, the administrator has the power to disable emoji support at a global level; but default this is not the case. |
| tz | Identify the IANA Time Zone Database you wish to operate as. By default this is detected based on the configuration the server hosting Apprise is running on. You can set this to things like America/Toronto, or any other properly formated Timezone describing your area. |
Acquiring A Group ID
Section titled “Acquiring A Group ID”Groups can be created in the app, or via the Signal Rest API Service. To get a list of available groups and their ids run:
curl -X GET -H "Content-Type: application/json" localhost:9922/v1/groups/+15555551234 | jqExample 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 groupExample sending a notification to a group: group.aabbccdd/eeffgghh= identified by the id.
Examples
Section titled “Examples”Send a Signal Notification (via Signal API):
# Assuming our {Hostname} is localhost (hosting the bbernhard/signal-cli-rest-api)# Assuming our {FromPhoneNo} is +1-900-555-9999# Assuming our {PhoneNo} - is in the US somewhere making our country code +1# - identifies as 800-555-1223apprise -vv -t "Test Message Title" -b "Test Message Body" \ "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"Based on my personal experiences, I was able to send a notification to myself by simply doing the following:
# Assuming our {Hostname} is localhost (hosting the bbernhard/signal-cli-rest-api)# Assuming our {Port} is 9922# Assuming our {FromPhoneNo} is +1 555 555 1234apprise -vv -t "Test Message Title" -b "Test Message Body" \ "signal://localhost:9922/15555551234"If you know the Group ID you want to notify, you can idenify it as well on the command line:
# 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:
apprise -vv -t -b "test" \ signal://localhost:9922/15555551234 --attach apprise-test.gifWhich produced:
