]> nmode's Git Repositories - signal-cli/blob - man/signal-cli-dbus.5.adoc
5d65c48fc64b77e7825b544cc231c8cc11c2f937
[signal-cli] / man / signal-cli-dbus.5.adoc
1 /////
2 vim:set ts=4 sw=4 tw=82 noet:
3 /////
4 :quotes.~:
5
6 = signal-cli-dbus (5)
7
8 == Name
9
10 DBus API for signal-cli - A commandline and dbus interface for the Signal messenger
11
12 == Synopsis
13
14 *signal-cli* [--verbose] [--config CONFIG] [-u USERNAME] [-o {plain-text,json}] daemon [--system]
15
16 *dbus-send* [--system | --session] [--print-reply] --type=method_call --dest="org.asamk.Signal" /org/asamk/Signal[/_<phonenum>] org.asamk.Signal.<method> [string:<string argument>] [array:<type>:<array argument>]
17
18 Note: when daemon was started without explicit `-u USERNAME`, the `dbus-send` command requires adding the phone number in `/org/asamk/Signal/_<phonenum>`.
19
20 == Description
21
22 See signal-cli (1) for details on the application.
23
24 This documentation handles the supported methods when running signal-cli as a DBus daemon.
25
26 The method are described as follows:
27
28 method(arg1<type>, arg2<type>, ...) -> return<type>
29
30 Where <type> is according to DBus specification:
31
32 * <s> : String
33 * <ay> : Byte Array
34 * <aay> : Array of Byte Arrays
35 * <as> : String Array
36 * <ax> : Array of signed 64 bit integer
37 * <b> : Boolean (0|1)
38 * <x> : Signed 64 bit integer
39 * <> : no return value
40
41 Exceptions are the names of the Java Exceptions returned in the body field. They typically contain an additional message with details. All Exceptions begin with "org.asamk.Signal.Error." which is omitted here for better readability.
42
43 Phone numbers always have the format +<countrycode><regional number>
44
45 == Methods
46
47 === Control methods
48 These methods are available if the daemon is started anonymously (without an explicit `-u USERNAME`).
49 Requests are sent to `/org/asamk/Signal`; requests related to individual accounts are sent to
50 `/org/asamk/Signal/_441234567890` where the + dialing code is replaced by an underscore (_).
51 Only `version()` is activated in single-user mode; the rest are disabled.
52
53 link() -> deviceLinkUri<s>::
54 link(newDeviceName<s>) -> deviceLinkUri<s>::
55 * newDeviceName : Name to give new device (defaults to "cli" if no name is given)
56 * deviceLinkUri : URI of newly linked device
57
58 Returns a URI of the form "tsdevice:/?uuid=...". This can be piped to a QR encoder to create a display that
59 can be captured by a Signal smartphone client. For example:
60
61 `dbus-send --session --dest=org.asamk.Signal --type=method_call --print-reply /org/asamk/Signal org.asamk.Signal.link string:"My secondary client"|tr '\n' '\0'|sed 's/.*string //g'|sed 's/\"//g'|qrencode -s10 -tANSI256`
62
63 Exception: Failure
64
65 listAccounts() -> accountList<as>::
66 * accountList : Array of all attached accounts in DBus object path form
67
68 Exceptions: None
69
70 register(number<s>, voiceVerification<b>) -> <>::
71 * number : Phone number
72 * voiceVerification : true = use voice verification; false = use SMS verification
73
74 Exceptions: Failure, InvalidNumber, RequiresCaptcha
75
76 registerWithCaptcha(number<s>, voiceVerification<b>, captcha<s>) -> <>::
77 * number : Phone number
78 * voiceVerification : true = use voice verification; false = use SMS verification
79 * captcha : Captcha string
80
81 Exceptions: Failure, InvalidNumber, RequiresCaptcha
82
83 verify(number<s>, verificationCode<s>) -> <>::
84 * number : Phone number
85 * verificationCode : Code received from Signal after successful registration request
86
87 Command fails if PIN was set after previous registration; use verifyWithPin instead.
88
89 Exception: Failure, InvalidNumber
90
91 verifyWithPin(number<s>, verificationCode<s>, pin<s>) -> <>::
92 * number : Phone number
93 * verificationCode : Code received from Signal after successful registration request
94 * pin : PIN you set with setPin command after verifying previous registration
95
96 Exception: Failure, InvalidNumber
97
98 version() -> version<s>::
99 * version : Version string of signal-cli
100
101 Exceptions: None
102
103 === Other methods
104
105 updateGroup(groupId<ay>, newName<s>, members<as>, avatar<s>) -> groupId<ay>::
106 * groupId : Byte array representing the internal group identifier
107 * newName : New name of group (empty if unchanged)
108 * members : String array of new members to be invited to group
109 * avatar : Filename of avatar picture to be set for group (empty if none)
110
111 Exceptions: AttachmentInvalid, Failure, InvalidNumber, GroupNotFound
112
113 updateProfile(newName<s>, about <s>, aboutEmoji <s>, avatar<s>, remove<b>) -> <>::
114 * newName : New name for your own profile (empty if unchanged)
115 * about : About message for profile (empty if unchanged)
116 * aboutEmoji : Emoji for profile (empty if unchanged)
117 * avatar : Filename of avatar picture for profile (empty if unchanged)
118 * remove : Set to 1 if the existing avatar picture should be removed
119
120 Exceptions: Failure
121
122
123 setExpirationTimer(number<s>, expiration<i>) -> <>::
124 * number : Phone number of recipient
125 * expiration : int32 for the number of seconds before messages to this recipient disappear. Set to 0 to disable expiration.
126
127 Exceptions: Failure
128
129 setContactBlocked(number<s>, block<b>) -> <>::
130 * number : Phone number affected by method
131 * block : 0=remove block , 1=blocked
132
133 Messages from blocked numbers will no longer be forwarded via DBus.
134
135 Exceptions: InvalidNumber
136
137 setGroupBlocked(groupId<ay>, block<b>) -> <>::
138 * groupId : Byte array representing the internal group identifier
139 * block : 0=remove block , 1=blocked
140
141 Messages from blocked groups will no longer be forwarded via DBus.
142
143 Exceptions: GroupNotFound
144
145 joinGroup(inviteURI<s>) -> <>::
146 * inviteURI : String starting with https://signal.group which is generated when you share a group link via Signal App
147
148 Exceptions: Failure
149
150 quitGroup(groupId<ay>) -> <>::
151 * groupId : Byte array representing the internal group identifier
152
153 Note that quitting a group will not remove the group from the getGroupIds command, but set it inactive which can be tested with isMember()
154
155 Exceptions: GroupNotFound, Failure
156
157 isMember(groupId<ay>) -> active<b>::
158 * groupId : Byte array representing the internal group identifier
159
160 Note that this method does not raise an Exception for a non-existing/unknown group but will simply return 0 (false)
161
162 sendEndSessionMessage(recipients<as>) -> <>::
163 * recipients : Array of phone numbers
164
165 Exceptions: Failure, InvalidNumber, UntrustedIdentity
166
167 sendGroupMessage(message<s>, attachments<as>, groupId<ay>) -> timestamp<x>::
168 * message : Text to send (can be UTF8)
169 * attachments : String array of filenames to send as attachments (passed as filename, so need to be readable by the user signal-cli is running under)
170 * groupId : Byte array representing the internal group identifier
171 * timestamp : Can be used to identify the corresponding signal reply
172
173 Exceptions: GroupNotFound, Failure, AttachmentInvalid
174
175 sendContacts() -> <>::
176
177 Sends a synchronization message with the local contacts list to all linked devices. This command should only be used if this is the primary device.
178
179 Exceptions: Failure
180
181 sendSyncRequest() -> <>::
182
183 Sends a synchronization request to the primary device (for group, contacts, ...). Only works if sent from a secondary device.
184
185 Exception: Failure
186
187 sendNoteToSelfMessage(message<s>, attachments<as>) -> timestamp<x>::
188 * message : Text to send (can be UTF8)
189 * attachments : String array of filenames to send as attachments (passed as filename, so need to be readable by the user signal-cli is running under)
190 * timestamp : Can be used to identify the corresponding signal reply
191
192 Exceptions: Failure, AttachmentInvalid
193
194 sendMessage(message<s>, attachments<as>, recipient<s>) -> timestamp<x>::
195 sendMessage(message<s>, attachments<as>, recipients<as>) -> timestamp<x>::
196 * message : Text to send (can be UTF8)
197 * attachments : String array of filenames to send as attachments (passed as filename, so need to be readable by the user signal-cli is running under)
198 * recipient : Phone number of a single recipient
199 * recipients : Array of phone numbers
200 * timestamp : Can be used to identify the corresponding signal reply
201
202 Depending on the type of the recipient field this sends a message to one or multiple recipients.
203
204 Exceptions: AttachmentInvalid, Failure, InvalidNumber, UntrustedIdentity
205
206 sendTyping(recipient<s>, stop<b>) -> <>::
207 * recipient : Phone number of a single recipient
208 * targetSentTimestamp : True, if typing state should be stopped
209
210 Exceptions: Failure, GroupNotFound, UntrustedIdentity
211
212
213 sendReadReceipt(recipient<s>, targetSentTimestamp<ax>) -> <>::
214 * recipient : Phone number of a single recipient
215 * targetSentTimestamp : Array of Longs to identify the corresponding signal messages
216
217 Exceptions: Failure, UntrustedIdentity
218
219 sendGroupMessageReaction(emoji<s>, remove<b>, targetAuthor<s>, targetSentTimestamp<x>, groupId<ay>) -> timestamp<x>::
220 * emoji : Unicode grapheme cluster of the emoji
221 * remove : Boolean, whether a previously sent reaction (emoji) should be removed
222 * targetAuthor : String with the phone number of the author of the message to which to react
223 * targetSentTimestamp : Long representing timestamp of the message to which to react
224 * groupId : Byte array with base64 encoded group identifier
225 * timestamp : Long, can be used to identify the corresponding signal reply
226
227 Exceptions: Failure, InvalidNumber, GroupNotFound
228
229 sendMessageReaction(emoji<s>, remove<b>, targetAuthor<s>, targetSentTimestamp<x>, recipient<s>) -> timestamp<x>::
230 sendMessageReaction(emoji<s>, remove<b>, targetAuthor<s>, targetSentTimestamp<x>, recipients<as>) -> timestamp<x>::
231 * emoji : Unicode grapheme cluster of the emoji
232 * remove : Boolean, whether a previously sent reaction (emoji) should be removed
233 * targetAuthor : String with the phone number of the author of the message to which to react
234 * targetSentTimestamp : Long representing timestamp of the message to which to react
235 * recipient : String with the phone number of a single recipient
236 * recipients : Array of strings with phone numbers, should there be more recipients
237 * timestamp : Long, can be used to identify the corresponding signal reply
238
239 Depending on the type of the recipient(s) field this sends a reaction to one or multiple recipients.
240
241 Exceptions: Failure, InvalidNumber
242
243 sendGroupRemoteDeleteMessage(targetSentTimestamp<x>, groupId<ay>) -> timestamp<x>::
244 * targetSentTimestamp : Long representing timestamp of the message to delete
245 * groupId : Byte array with base64 encoded group identifier
246 * timestamp : Long, can be used to identify the corresponding signal reply
247
248 Exceptions: Failure, GroupNotFound
249
250 sendRemoteDeleteMessage(targetSentTimestamp<x>, recipient<s>) -> timestamp<x>::
251 sendRemoteDeleteMessage(targetSentTimestamp<x>, recipients<as>) -> timestamp<x>::
252 * targetSentTimestamp : Long representing timestamp of the message to delete
253 * recipient : String with the phone number of a single recipient
254 * recipients : Array of strings with phone numbers, should there be more recipients
255 * timestamp : Long, can be used to identify the corresponding signal reply
256
257 Depending on the type of the recipient(s) field this deletes a message with one or multiple recipients.
258
259 Exceptions: Failure, InvalidNumber
260
261 getContactName(number<s>) -> name<s>::
262 * number : Phone number
263 * name : Contact's name in local storage (from the master device for a linked account, or the one set with setContactName); if not set, contact's profile name is used
264
265 setContactName(number<s>,name<>) -> <>::
266 * number : Phone number
267 * name : Name to be set in contacts (in local storage with signal-cli)
268
269 getGroupIds() -> groupList<aay>::
270 groupList : Array of Byte arrays representing the internal group identifiers
271
272 All groups known are returned, regardless of their active or blocked status. To query that use isMember() and isGroupBlocked()
273
274 getGroupName(groupId<ay>) -> groupName<s>::
275 groupName : The display name of the group
276 groupId : Byte array representing the internal group identifier
277
278 Exceptions: None, if the group name is not found an empty string is returned
279
280 getGroupMembers(groupId<ay>) -> members<as>::
281 members : String array with the phone numbers of all active members of a group
282 groupId : Byte array representing the internal group identifier
283
284 Exceptions: None, if the group name is not found an empty array is returned
285
286 listNumbers() -> numbers<as>::
287 numbers : String array of all known numbers
288
289 This is a concatenated list of all defined contacts as well of profiles known (e.g. peer group members or sender of received messages)
290
291 getContactNumber(name<s>) -> numbers<as>::
292 * numbers : Array of phone number
293 * name : Contact or profile name ("firstname lastname")
294
295 Searches contacts and known profiles for a given name and returns the list of all known numbers. May result in e.g. two entries if a contact and profile name is set.
296
297 isContactBlocked(number<s>) -> state<b>::
298 * number : Phone number
299 * state : 1=blocked, 0=not blocked
300
301 Exceptions: None, for unknown numbers 0 (false) is returned
302
303 isGroupBlocked(groupId<ay>) -> state<b>::
304 * groupId : Byte array representing the internal group identifier
305 * state : 1=blocked, 0=not blocked
306
307 Exceptions: None, for unknown groups 0 (false) is returned
308
309 removePin() -> <>::
310
311 Removes registration PIN protection.
312
313 Exception: Failure
314
315 setPin(pin<s>) -> <>::
316 * pin : PIN you set after registration (resets after 7 days of inactivity)
317
318 Sets a registration lock PIN, to prevent others from registering your number.
319
320 Exception: Failure
321
322 version() -> version<s>::
323 * version : Version string of signal-cli
324
325 isRegistred -> result<b>::
326 * result : Currently always returns 1=true
327
328 addDevice(deviceUri<s>) -> <>::
329 * deviceUri : URI in the form of tsdevice:/?uuid=... Normally received from Signal desktop or smartphone app
330
331 Exception: InvalidUri
332
333 listDevices() -> devices<as>::
334 * devices : String array of linked devices
335
336 Exception: Failure
337
338 removeDevice(deviceId<i>) -> <>::
339 * deviceId : Device ID to remove, obtained from listDevices() command
340
341 Exception: Failure
342
343 updateDeviceName(deviceName<s>) -> <>::
344 * deviceName : New name
345
346 Set a new name for this device (main or linked).
347
348 Exception: Failure
349
350 uploadStickerPack(stickerPackPath<s>) -> url<s>::
351 * stickerPackPath : Path to the manifest.json file or a zip file in the same directory
352 * url : URL of sticker pack after successful upload
353
354 Exception: Failure
355
356 == Signals
357
358 SyncMessageReceived (timestamp<x>, sender<s>, destination<s>, groupId<ay>,message<s>, attachments<as>)::
359 The sync message is received when the user sends a message from a linked device.
360
361 ReceiptReceived (timestamp<x>, sender<s>)::
362 * timestamp : Integer value that can be used to associate this e.g. with a sendMessage()
363 * sender : Phone number of the sender
364
365 This signal is sent by each recipient (e.g. each group member) after the message was successfully delivered to the device
366
367 MessageReceived(timestamp<x>, sender<s>, groupId<ay>, message<s>, attachments<as>)::
368 * timestamp : Integer value that is used by the system to send a ReceiptReceived reply
369 * sender : Phone number of the sender
370 * groupId : Byte array representing the internal group identifier (empty when private message)
371 * message : Message text
372 * attachments : String array of filenames for the attachments. These files are located in the signal-cli storage and the current user needs to have read access there
373
374 This signal is received whenever we get a private message or a message is posted in a group we are an active member
375
376 == Examples
377
378 Send a text message (without attachment) to a contact::
379 dbus-send --print-reply --type=method_call --dest="org.asamk.Signal" /org/asamk/Signal org.asamk.Signal.sendMessage string:"Message text goes here" array:string: string:+123456789
380
381 Send a group message::
382 dbus-send --session --print-reply --type=method_call --dest=org.asamk.Signal /org/asamk/Signal org.asamk.Signal.sendGroupMessage string:'The message goes here' array:string:'/path/to/attachmnt1','/path/to/attachmnt2' array:byte:139,22,72,247,116,32,170,104,205,164,207,21,248,77,185
383
384 Print the group name corresponding to a groupId; the daemon runs on system bus, and was started without an explicit `-u USERNAME`::
385 dbus-send --system --print-reply --type=method_call --dest='org.asamk.Signal' /org/asamk/Signal/_1234567890 org.asamk.Signal.getGroupName array:byte:139,22,72,247,116,32,170,104,205,164,207,21,248,77,185
386
387 == Authors
388
389 Maintained by AsamK <asamk@gmx.de>, who is assisted by other open source contributors.
390 For more information about signal-cli development, see
391 <https://github.com/AsamK/signal-cli>.