bbernhard / signal-cli-rest-api

Dockerized Signal Messenger REST API
https://bbernhard.github.io/signal-cli-rest-api/
MIT License
1.36k stars 158 forks source link

Message delivered and read status #487

Open tj57 opened 8 months ago

tj57 commented 8 months ago

Feature Request

Is it possible to verify that a specific message has been delivered or read by the recipient? If not, I would like to report such functionality

Envelope from: “” +XXX (device: 2) to +YYY
Timestamp: 1708285141830 (2024-02-18T19:39:01.830Z)
Server timestamps: received: 1708285141953 (2024-02-18T19:39:01.953Z) delivered: 1708285142925 (2024-02-18T19:39:02.925Z)
Sent by unidentified/sealed sender
Received a receipt message
  When: 1708285141830 (2024-02-18T19:39:01.830Z)
  Is read receipt
  Timestamps:
  - 1708285134389 (2024-02-18T19:38:54.389Z)
bbernhard commented 8 months ago

As mentioned here you get the information via the receive. The receive command is exposed via the receive REST API endpoint.

tj57 commented 8 months ago

Thank you for your reply. I am trying to call this function, like

 curl -X 'GET' \
  'http://nas:8488/v1/receive/%2B48726447181' \
  -H 'accept: application/json'

but I got

Bad Request
{"error":"websocket: the client is not using the websocket protocol: 'upgrade' token not found in 'Connection' header"}

with this I got not output

curl -X 'GET' \
-H 'accept: application/json' \
--no-buffer \
--header "Connection: Upgrade" \
--header "Upgrade: websocket" \
--header "Sec-WebSocket-Version: 13" \
--header "Sec-WebSocket-Key: SGVsbG8sIHdvcmxkIQ==" \
--output - \
 'http://nas:8488/v1/receive/%2B48726447181'  

How to read correct Sec-WebSocket-Key ? What am I doing wrong?

bbernhard commented 8 months ago

In json-rpc node you need to establish a websocket connection instead of a HTTP connection to the receive endpoint. You can use any websocket client you want. e.g wscat

tj57 commented 8 months ago

Ok, it works with websocat Do i understand correctly that in order to receive read receipts i have to pull listen on endpoint /v1/receive all messages and on v2/send send a message in another thread ?

How to match these messages ? On receive I see sourceUuid, but on /v2/send with {"logging": {"level": "debug"}... only {"timestamp":"1708629181076"}