]> nmode's Git Repositories - signal-cli/blob - man/signal-cli-dbus.5.adoc
Update documentation
[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 * <a> : Array of ... (comma-separated list)
33 * (...) : Struct (cannot be sent via `dbus-send`)
34 * <b> : Boolean (false|true) (boolean:)
35 * <i> : Signed 32-bit (int) integer (int32:)
36 * <o> : DBusPath object (objpath:)
37 * <s> : String (string:)
38 * <x> : Signed 64-bit (long) integer (int64:)
39 * <y> : Unsigned 8-bit (byte) integer (byte:)
40 * <> : no return value
41
42 The final parenthetical value (such as "boolean:") is the type indicator used by `dbus-send`.
43
44 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.
45
46 Phone numbers always have the format +<countrycode><regional number>
47
48 == Methods
49
50 === Control methods
51 These methods are available if the daemon is started anonymously (without an explicit `-u USERNAME`).
52 Requests are sent to `/org/asamk/Signal`; requests related to individual accounts are sent to
53 `/org/asamk/Signal/_441234567890` where the + dialing code is replaced by an underscore (_).
54 Only `version()` is activated in single-user mode; the rest are disabled.
55
56 link() -> deviceLinkUri<s>::
57 link(newDeviceName<s>) -> deviceLinkUri<s>::
58 * newDeviceName : Name to give new device (defaults to "cli" if no name is given)
59 * deviceLinkUri : URI of newly linked device
60
61 Returns a URI of the form "sgnl://linkdevice/?uuid=...". This can be piped to a QR encoder to create a display that
62 can be captured by a Signal smartphone client. For example:
63
64 `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`
65
66 Exceptions: Failure
67
68 listAccounts() -> accountList<as>::
69 * accountList : Array of all attached accounts in DBus object path form
70
71 Exceptions: None
72
73 register(number<s>, voiceVerification<b>) -> <>::
74 * number : Phone number
75 * voiceVerification : true = use voice verification; false = use SMS verification
76
77 Exceptions: Failure, InvalidNumber, RequiresCaptcha
78
79 registerWithCaptcha(number<s>, voiceVerification<b>, captcha<s>) -> <>::
80 * number : Phone number
81 * voiceVerification : true = use voice verification; false = use SMS verification
82 * captcha : Captcha string
83
84 Exceptions: Failure, InvalidNumber, RequiresCaptcha
85
86 verify(number<s>, verificationCode<s>) -> <>::
87 * number : Phone number
88 * verificationCode : Code received from Signal after successful registration request
89
90 Command fails if PIN was set after previous registration; use verifyWithPin instead.
91
92 Exceptions: Failure, InvalidNumber
93
94 verifyWithPin(number<s>, verificationCode<s>, pin<s>) -> <>::
95 * number : Phone number
96 * verificationCode : Code received from Signal after successful registration request
97 * pin : PIN you set with setPin command after verifying previous registration
98
99 Exceptions: Failure, InvalidNumber
100
101 version() -> version<s>::
102 * version : Version string of signal-cli
103
104 Exceptions: None
105
106 === Device methods
107 Requests for these methods are sent to a specific device (main or linked); the list is available
108 from the listDevices() method (see below under "Other methods").
109
110 removeDevice() -> <>::
111
112 Exceptions: Failure
113
114 === Other methods
115
116 updateGroup(groupId<ay>, newName<s>, members<as>, avatar<s>) -> groupId<ay>::
117 * groupId : Byte array representing the internal group identifier
118 * newName : New name of group (empty if unchanged)
119 * members : String array of new members to be invited to group
120 * avatar : Filename of avatar picture to be set for group (empty if none)
121
122 Exceptions: AttachmentInvalid, Failure, InvalidNumber, GroupNotFound
123
124 updateProfile(name<s>, about<s>, aboutEmoji <s>, avatar<s>, remove<b>) -> <>::
125 updateProfile(givenName<s>, familyName<s>, about<s>, aboutEmoji <s>, avatar<s>, remove<b>) -> <>::
126 * name : Name for your own profile (empty if unchanged)
127 * givenName : Given name for your own profile (empty if unchanged)
128 * familyName : Family name for your own profile (empty if unchanged)
129 * about : About message for profile (empty if unchanged)
130 * aboutEmoji : Emoji for profile (empty if unchanged)
131 * avatar : Filename of avatar picture for profile (empty if unchanged)
132 * remove : Set to true if the existing avatar picture should be removed
133
134 Exceptions: Failure
135
136
137 setExpirationTimer(number<s>, expiration<i>) -> <>::
138 * number : Phone number of recipient
139 * expiration : int32 for the number of seconds before messages to this recipient disappear. Set to 0 to disable expiration.
140
141 Exceptions: Failure, InvalidNumber
142
143 setContactBlocked(number<s>, block<b>) -> <>::
144 * number : Phone number affected by method
145 * block : false=remove block, true=blocked
146
147 Messages from blocked numbers will no longer be forwarded via DBus.
148
149 Exceptions: InvalidNumber
150
151 setGroupBlocked(groupId<ay>, block<b>) -> <>::
152 * groupId : Byte array representing the internal group identifier
153 * block : false=remove block , true=blocked
154
155 Messages from blocked groups will no longer be forwarded via DBus.
156
157 Exceptions: GroupNotFound, InvalidGroupId
158
159 joinGroup(inviteURI<s>) -> <>::
160 * inviteURI : String starting with https://signal.group which is generated when you share a group link via Signal App
161
162 Exceptions: Failure
163
164 quitGroup(groupId<ay>) -> <>::
165 * groupId : Byte array representing the internal group identifier
166
167 Note that quitting a group will not remove the group from the getGroupIds command, but set it inactive which can be tested with isMember()
168
169 Exceptions: GroupNotFound, Failure, InvalidGroupId
170
171 isMember(groupId<ay>) -> isMember<b>::
172 * groupId : Byte array representing the internal group identifier
173 * isMember : true=you are a group member; false=you are not a group member
174
175 Note that this method does not raise an Exception for a non-existing/unknown group but will simply return 0 (false)
176
177 sendEndSessionMessage(recipients<as>) -> <>::
178 * recipients : Array of phone numbers
179
180 Exceptions: Failure, InvalidNumber, UntrustedIdentity
181
182 sendGroupMessage(message<s>, attachments<as>, groupId<ay>) -> timestamp<x>::
183 * message : Text to send (can be UTF8)
184 * 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)
185 * groupId : Byte array representing the internal group identifier
186 * timestamp : Long, can be used to identify the corresponding Signal reply
187
188 Exceptions: GroupNotFound, Failure, AttachmentInvalid, InvalidGroupId
189
190 sendContacts() -> <>::
191
192 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.
193
194 Exceptions: Failure
195
196 sendSyncRequest() -> <>::
197
198 Sends a synchronization request to the primary device (for group, contacts, ...). Only works if sent from a secondary device.
199
200 Exceptions: Failure
201
202 sendNoteToSelfMessage(message<s>, attachments<as>) -> timestamp<x>::
203 * message : Text to send (can be UTF8)
204 * 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)
205 * timestamp : Long, can be used to identify the corresponding Signal reply
206
207 Exceptions: Failure, AttachmentInvalid
208
209 sendMessage(message<s>, attachments<as>, recipient<s>) -> timestamp<x>::
210 sendMessage(message<s>, attachments<as>, recipients<as>) -> timestamp<x>::
211 * message : Text to send (can be UTF8)
212 * 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)
213 * recipient : Phone number of a single recipient
214 * recipients : String array of phone numbers
215 * timestamp : Long, can be used to identify the corresponding Signal reply
216
217 Depending on the type of the recipient field this sends a message to one or multiple recipients.
218
219 Exceptions: AttachmentInvalid, Failure, InvalidNumber, UntrustedIdentity
220
221 sendTyping(recipient<s>, stop<b>) -> <>::
222 * recipient : Phone number of a single recipient
223 * targetSentTimestamp : True, if typing state should be stopped
224
225 Exceptions: Failure, GroupNotFound, UntrustedIdentity
226
227 sendReadReceipt(recipient<s>, targetSentTimestamps<ax>) -> <>::
228 * recipient : Phone number of a single recipient
229 * targetSentTimestamps : Array of Longs to identify the corresponding Signal messages
230
231 Exceptions: Failure, UntrustedIdentity
232
233 sendGroupMessageReaction(emoji<s>, remove<b>, targetAuthor<s>, targetSentTimestamp<x>, groupId<ay>) -> timestamp<x>::
234 * emoji : Unicode grapheme cluster of the emoji
235 * remove : Boolean, whether a previously sent reaction (emoji) should be removed
236 * targetAuthor : String with the phone number of the author of the message to which to react
237 * targetSentTimestamp : Long representing timestamp of the message to which to react
238 * groupId : Byte array representing the internal group identifier
239 * timestamp : Long, can be used to identify the corresponding signal reply
240
241 Exceptions: Failure, InvalidNumber, GroupNotFound, InvalidGroupId
242
243 sendMessageReaction(emoji<s>, remove<b>, targetAuthor<s>, targetSentTimestamp<x>, recipient<s>) -> timestamp<x>::
244 sendMessageReaction(emoji<s>, remove<b>, targetAuthor<s>, targetSentTimestamp<x>, recipients<as>) -> timestamp<x>::
245 * emoji : Unicode grapheme cluster of the emoji
246 * remove : Boolean, whether a previously sent reaction (emoji) should be removed
247 * targetAuthor : String with the phone number of the author of the message to which to react
248 * targetSentTimestamp : Long representing timestamp of the message to which to react
249 * recipient : String with the phone number of a single recipient
250 * recipients : Array of strings with phone numbers, should there be more recipients
251 * timestamp : Long, can be used to identify the corresponding Signal reply
252
253 Depending on the type of the recipient(s) field this sends a reaction to one or multiple recipients.
254
255 Exceptions: Failure, InvalidNumber
256
257 sendGroupRemoteDeleteMessage(targetSentTimestamp<x>, groupId<ay>) -> timestamp<x>::
258 * targetSentTimestamp : Long representing timestamp of the message to delete
259 * groupId : Byte array with base64 encoded group identifier
260 * timestamp : Long, can be used to identify the corresponding signal reply
261
262 Exceptions: Failure, GroupNotFound, InvalidGroupId
263
264 sendRemoteDeleteMessage(targetSentTimestamp<x>, recipient<s>) -> timestamp<x>::
265 sendRemoteDeleteMessage(targetSentTimestamp<x>, recipients<as>) -> timestamp<x>::
266 * targetSentTimestamp : Long representing timestamp of the message to delete
267 * recipient : String with the phone number of a single recipient
268 * recipients : Array of strings with phone numbers, should there be more recipients
269 * timestamp : Long, can be used to identify the corresponding signal reply
270
271 Depending on the type of the recipient(s) field this deletes a message with one or multiple recipients.
272
273 Exceptions: Failure, InvalidNumber
274
275 getContactName(number<s>) -> name<s>::
276 * number : Phone number
277 * 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
278
279 Exceptions: None
280
281 setContactName(number<s>,name<>) -> <>::
282 * number : Phone number
283 * name : Name to be set in contacts (in local storage with signal-cli)
284
285 Exceptions: InvalidNumber, Failure
286
287 getGroupIds() -> groupList<aay>::
288 groupList : Array of Byte arrays representing the internal group identifiers
289
290 All groups known are returned, regardless of their active or blocked status. To query that use isMember() and isGroupBlocked()
291
292 Exceptions: None
293
294 getGroupName(groupId<ay>) -> groupName<s>::
295 * groupId : Byte array representing the internal group identifier
296 * groupName : The display name of the group
297
298 Exceptions: None, if the group name is not found an empty string is returned
299
300 getGroupMembers(groupId<ay>) -> members<as>::
301 * groupId : Byte array representing the internal group identifier
302 * members : String array with the phone numbers of all active members of a group
303
304 Exceptions: None, if the group name is not found an empty array is returned
305
306 listNumbers() -> numbers<as>::
307 * numbers : String array of all known numbers
308
309 This is a concatenated list of all defined contacts as well of profiles known (e.g. peer group members or sender of received messages)
310
311 Exceptions: None
312
313 getContactNumber(name<s>) -> numbers<as>::
314 * numbers : Array of phone number
315 * name : Contact or profile name ("firstname lastname")
316
317 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.
318
319 Exceptions: None
320
321 isContactBlocked(number<s>) -> blocked<b>::
322 * number : Phone number
323 * blocked : true=blocked, false=not blocked
324
325 For unknown numbers false is returned but no exception is raised.
326
327 Exceptions: InvalidPhoneNumber
328
329 isGroupBlocked(groupId<ay>) -> isGroupBlocked<b>::
330 * groupId : Byte array representing the internal group identifier
331 * isGroupBlocked : true=group is blocked; false=group is not blocked
332
333 Dbus will not forward messages from a group when you have blocked it.
334
335 Exceptions: InvalidGroupId, Failure
336
337 removePin() -> <>::
338
339 Removes registration PIN protection.
340
341 Exceptions: Failure
342
343 setPin(pin<s>) -> <>::
344 * pin : PIN you set after registration (resets after 7 days of inactivity)
345
346 Sets a registration lock PIN, to prevent others from registering your number.
347
348 Exceptions: Failure
349
350 version() -> version<s>::
351 * version : Version string of signal-cli
352
353 Exceptions: None
354
355 getSelfNumber() -> number<s>::
356 * number : Your phone number
357
358 Exceptions: None
359
360 isRegistered() -> result<b>::
361 isRegistered(number<s>) -> result<b>::
362 isRegistered(numbers<as>) -> results<ab>::
363 * number : Phone number
364 * numbers : String array of phone numbers
365 * result : true=number is registered, false=number is not registered
366 * results : Boolean array of results
367
368 For unknown numbers, false is returned, but no exception is raised. If no number is given, returns true (indicating that you are registered).
369
370 Exceptions: InvalidNumber
371
372 addDevice(deviceUri<s>) -> <>::
373 * deviceUri : URI in the form of "sgnl://linkdevice/?uuid=..." (formerly "tsdevice:/?uuid=...") Normally displayed by a Signal desktop app, smartphone app, or another signal-cli instance using the `link` control method.
374
375 listDevices() -> devices<a(oxs)>::
376 * devices : Array of structs (objectPath, id, name)
377 ** objectPath : DBusPath representing the device's object path
378 ** id : Long representing the deviceId
379 ** name : String representing the device's name
380
381 Exceptions: InvalidUri
382
383 getDevice(deviceId<x>) -> devicePath<o>::
384 * deviceId : Long representing a (potential) deviceId
385 * devicePath : DBusPath object for the device
386
387 Exceptions: DeviceNotFound
388
389 uploadStickerPack(stickerPackPath<s>) -> url<s>::
390 * stickerPackPath : Path to the manifest.json file or a zip file in the same directory
391 * url : URL of sticker pack after successful upload
392
393 Exceptions: Failure
394
395 submitRateLimitChallenge(challenge<s>, captcha<s>) -> <>::
396 * challenge : The challenge token taken from the proof required error.
397 * captcha : The captcha token from the solved captcha on the Signal website..
398 Can be used to lift some rate-limits by solving a captcha.
399
400 Exception: IOErrorException
401
402 == Signals
403 SyncMessageReceived (timestamp<x>, sender<s>, destination<s>, groupId<ay>, message<s>, attachments<as>)::
404 * timestamp : Integer value that can be used to associate this e.g. with a sendMessage()
405 * sender : Phone number of the sender
406 * destination : DBus code for destination
407 * groupId : Byte array representing the internal group identifier (empty when private message)
408 * message : Message text
409 * attachments : String array of filenames in the signal-cli storage (~/.local/share/signal-cli/attachments/)
410
411 The sync message is received when the user sends a message from a linked device.
412
413 ReceiptReceived (timestamp<x>, sender<s>)::
414 * timestamp : Integer value that can be used to associate this e.g. with a sendMessage()
415 * sender : Phone number of the sender
416
417 This signal is sent by each recipient (e.g. each group member) after the message was successfully delivered to the device
418
419 MessageReceived(timestamp<x>, sender<s>, groupId<ay>, message<s>, attachments<as>)::
420 * timestamp : Integer value that is used by the system to send a ReceiptReceived reply
421 * sender : Phone number of the sender
422 * groupId : Byte array representing the internal group identifier (empty when private message)
423 * message : Message text
424 * attachments : String array of filenames in the signal-cli storage (~/.local/share/signal-cli/attachments/)
425
426 This signal is received whenever we get a private message or a message is posted in a group we are an active member
427
428 == Examples
429
430 Send a text message (without attachment) to a contact::
431 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
432
433 Send a group message::
434 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
435
436 Print the group name corresponding to a groupId; the daemon runs on system bus, and was started without an explicit `-u USERNAME`::
437 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
438
439 == Authors
440
441 Maintained by AsamK <asamk@gmx.de>, who is assisted by other open source contributors.
442 For more information about signal-cli development, see
443 <https://github.com/AsamK/signal-cli>.