]> nmode's Git Repositories - signal-cli/blob - man/signal-cli-dbus.5.adoc
Implement --delete flag for quitGroup
[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 * <b> : Boolean (0|1)
37 * <x> : Signed 64 bit integer
38 * <> : no return value
39
40 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.
41
42 Phone numbers always have the format +<countrycode><regional number>
43
44 == Methods
45
46 updateGroup(groupId<ay>, newName<s>, members<as>, avatar<s>) -> groupId<ay>::
47 * groupId : Byte array representing the internal group identifier
48 * newName : New name of group (empty if unchanged)
49 * members : String array of new members to be invited to group
50 * avatar : Filename of avatar picture to be set for group (empty if none)
51
52 Exceptions: AttachmentInvalid, Failure, InvalidNumber, GroupNotFound
53
54 updateProfile(newName<s>, about <s>, aboutEmoji <s>, avatar<s>, remove<b>) -> <>::
55 * newName : New name for your own profile (empty if unchanged)
56 * about : About message for profile (empty if unchanged)
57 * aboutEmoji : Emoji for profile (empty if unchanged)
58 * avatar : Filename of avatar picture for profile (empty if unchanged)
59 * remove : Set to 1 if the existing avatar picture should be removed
60
61 Exceptions: Failure
62
63 setContactBlocked(number<s>, block<b>) -> <>::
64 * number : Phone number affected by method
65 * block : 0=remove block , 1=blocked
66
67 Messages from blocked numbers will no longer be forwarded via DBus.
68
69 Exceptions: InvalidNumber
70
71 setGroupBlocked(groupId<ay>, block<b>) -> <>::
72 * groupId : Byte array representing the internal group identifier
73 * block : 0=remove block , 1=blocked
74
75 Messages from blocked groups will no longer be forwarded via DBus.
76
77 Exceptions: GroupNotFound
78
79 joinGroup(inviteURI<s>) -> <>::
80 * inviteURI : String starting with https://signal.group which is generated when you share a group link via Signal App
81
82 Exceptions: Failure
83
84 quitGroup(groupId<ay>) -> <>::
85 * groupId : Byte array representing the internal group identifier
86
87 Note that quitting a group will not remove the group from the getGroupIds command, but set it inactive which can be tested with isMember()
88
89 Exceptions: GroupNotFound, Failure
90
91 isMember(groupId<ay>) -> active<b>::
92 * groupId : Byte array representing the internal group identifier
93
94 Note that this method does not raise an Exception for a non-existing/unknown group but will simply return 0 (false)
95
96 sendEndSessionMessage(recipients<as>) -> <>::
97 * recipients : Array of phone numbers
98
99 Exceptions: Failure, InvalidNumber, UntrustedIdentity
100
101 sendGroupMessage(message<s>, attachments<as>, groupId<ay>) -> timestamp<x>::
102 * message : Text to send (can be UTF8)
103 * 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)
104 * groupId : Byte array representing the internal group identifier
105 * timestamp : Can be used to identify the corresponding signal reply
106
107 Exceptions: GroupNotFound, Failure, AttachmentInvalid
108
109 sendNoteToSelfMessage(message<s>, attachments<as>) -> timestamp<x>::
110 * message : Text to send (can be UTF8)
111 * 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)
112 * timestamp : Can be used to identify the corresponding signal reply
113
114 Exceptions: Failure, AttachmentInvalid
115
116 sendMessage(message<s>, attachments<as>, recipient<s>) -> timestamp<x>::
117 sendMessage(message<s>, attachments<as>, recipients<as>) -> timestamp<x>::
118 * message : Text to send (can be UTF8)
119 * 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)
120 * recipient : Phone number of a single recipient
121 * recipients : Array of phone numbers
122 * timestamp : Can be used to identify the corresponding signal reply
123
124 Depending on the type of the recipient field this sends a message to one or multiple recipients.
125
126 Exceptions: AttachmentInvalid, Failure, InvalidNumber, UntrustedIdentity
127
128 sendGroupMessageReaction(emoji<s>, remove<b>, targetAuthor<s>, targetSentTimestamp<x>, groupId<ay>) -> timestamp<x>::
129 * emoji : Unicode grapheme cluster of the emoji
130 * remove : Boolean, whether a previously sent reaction (emoji) should be removed
131 * targetAuthor : String with the phone number of the author of the message to which to react
132 * targetSentTimestamp : Long representing timestamp of the message to which to react
133 * groupId : Byte array with base64 encoded group identifier
134 * timestamp : Long, can be used to identify the corresponding signal reply
135
136 Exceptions: Failure, InvalidNumber, GroupNotFound
137
138 sendMessageReaction(emoji<s>, remove<b>, targetAuthor<s>, targetSentTimestamp<x>, recipient<s>) -> timestamp<x>::
139 sendMessageReaction(emoji<s>, remove<b>, targetAuthor<s>, targetSentTimestamp<x>, recipients<as>) -> timestamp<x>::
140 * emoji : Unicode grapheme cluster of the emoji
141 * remove : Boolean, whether a previously sent reaction (emoji) should be removed
142 * targetAuthor : String with the phone number of the author of the message to which to react
143 * targetSentTimestamp : Long representing timestamp of the message to which to react
144 * recipient : String with the phone number of a single recipient
145 * recipients : Array of strings with phone numbers, should there be more recipients
146 * timestamp : Long, can be used to identify the corresponding signal reply
147
148 Depending on the type of the recipient(s) field this sends a reaction to one or multiple recipients.
149
150 Exceptions: Failure, InvalidNumber
151
152 sendGroupRemoteDeleteMessage(targetSentTimestamp<x>, groupId<ay>) -> timestamp<x>::
153 * targetSentTimestamp : Long representing timestamp of the message to delete
154 * groupId : Byte array with base64 encoded group identifier
155 * timestamp : Long, can be used to identify the corresponding signal reply
156
157 Exceptions: Failure, GroupNotFound
158
159 sendRemoteDeleteMessage(targetSentTimestamp<x>, recipient<s>) -> timestamp<x>::
160 sendRemoteDeleteMessage(targetSentTimestamp<x>, recipients<as>) -> timestamp<x>::
161 * targetSentTimestamp : Long representing timestamp of the message to delete
162 * recipient : String with the phone number of a single recipient
163 * recipients : Array of strings with phone numbers, should there be more recipients
164 * timestamp : Long, can be used to identify the corresponding signal reply
165
166 Depending on the type of the recipient(s) field this deletes a message with one or multiple recipients.
167
168 Exceptions: Failure, InvalidNumber
169
170 getContactName(number<s>) -> name<s>::
171 * number : Phone number
172 * 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
173
174 setContactName(number<s>,name<>) -> <>::
175 * number : Phone number
176 * name : Name to be set in contacts (in local storage with signal-cli)
177
178 getGroupIds() -> groupList<aay>::
179 groupList : Array of Byte arrays representing the internal group identifiers
180
181 All groups known are returned, regardless of their active or blocked status. To query that use isMember() and isGroupBlocked()
182
183 getGroupName(groupId<ay>) -> groupName<s>::
184 groupName : The display name of the group
185 groupId : Byte array representing the internal group identifier
186
187 Exceptions: None, if the group name is not found an empty string is returned
188
189 getGroupMembers(groupId<ay>) -> members<as>::
190 members : String array with the phone numbers of all active members of a group
191 groupId : Byte array representing the internal group identifier
192
193 Exceptions: None, if the group name is not found an empty array is returned
194
195 listNumbers() -> numbers<as>::
196 numbers : String array of all known numbers
197
198 This is a concatenated list of all defined contacts as well of profiles known (e.g. peer group members or sender of received messages)
199
200 getContactNumber(name<s>) -> numbers<as>::
201 * numbers : Array of phone number
202 * name : Contact or profile name ("firstname lastname")
203
204 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.
205
206 isContactBlocked(number<s>) -> state<b>::
207 * number : Phone number
208 * state : 1=blocked, 0=not blocked
209
210 Exceptions: None, for unknown numbers 0 (false) is returned
211
212 isGroupBlocked(groupId<ay>) -> state<b>::
213 * groupId : Byte array representing the internal group identifier
214 * state : 1=blocked, 0=not blocked
215
216 Exceptions: None, for unknown groups 0 (false) is returned
217
218 version() -> version<s>::
219 * version : Version string of signal-cli
220
221 isRegistred -> result<b>::
222 * result : Currently always returns 1=true
223
224 == Signals
225
226 SyncMessageReceived (timestamp<x>, sender<s>, destination<s>, groupId<ay>,message<s>, attachments<as>)::
227 The sync message is received when the user sends a message from a linked device.
228
229 ReceiptReceived (timestamp<x>, sender<s>)::
230 * timestamp : Integer value that can be used to associate this e.g. with a sendMessage()
231 * sender : Phone number of the sender
232
233 This signal is sent by each recipient (e.g. each group member) after the message was successfully delivered to the device
234
235 MessageReceived(timestamp<x>, sender<s>, groupId<ay>, message<s>, attachments<as>)::
236 * timestamp : Integer value that is used by the system to send a ReceiptReceived reply
237 * sender : Phone number of the sender
238 * groupId : Byte array representing the internal group identifier (empty when private message)
239 * message : Message text
240 * 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
241
242 This signal is received whenever we get a private message or a message is posted in a group we are an active member
243
244 == Examples
245
246 Send a text message (without attachment) to a contact::
247 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
248
249 Send a group message::
250 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
251
252 Print the group name corresponding to a groupId; the daemon runs on system bus, and was started without an explicit `-u USERNAME`::
253 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
254
255 == Authors
256
257 Maintained by AsamK <asamk@gmx.de>, who is assisted by other open source contributors.
258 For more information about signal-cli development, see
259 <https://github.com/AsamK/signal-cli>.