///// vim:set ts=4 sw=4 tw=82 noet: ///// :quotes.~: = signal-cli-dbus (5) == Name DBus API for signal-cli - A commandline and dbus interface for the Signal messenger == Synopsis *signal-cli* [--verbose] [--config CONFIG] [-u USERNAME] [-o {plain-text,json}] daemon [--system] *dbus-send* [--system | --session] [--print-reply] --type=method_call --dest="org.asamk.Signal" /org/asamk/Signal[/_] org.asamk.Signal. [string:] [array::] Note: when daemon was started without explicit `-u USERNAME`, the `dbus-send` command requires adding the phone number in `/org/asamk/Signal/_`. == Description See signal-cli (1) for details on the application. This documentation handles the supported methods when running signal-cli as a DBus daemon. The method are described as follows: method(arg1, arg2, ...) -> return Where is according to DBus specification: * : Array of ... * : String * : Byte * : Boolean (false|true) * : Signed 64-bit integer (long) * : Signed 32-bit integer (int) * <> : no return value 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. Phone numbers always have the format + == Methods for org.asamk.Signal updateGroup(groupId, name, addMembers, avatar) -> groupId:: updateGroup(base64GroupId, name, addMembers, avatar) -> base64GroupId:: updateGroup(base64GroupId, name, description, addMembers, removeMembers, addAdmins, removeAdmins, resetGroupLink, groupLinkState, addMemberPermission, editDetailsPermission, avatar expiration) -> base64GroupId:: * groupId : Byte array representing the internal group identifier * base64GroupId : String representing the internal group identifier in Base64 format * name : Name of group (empty if unchanged) * description : Description (empty if unchanged) * addMembers : String array of new members to be invited to group (empty if unchanged) * removeMembers : String array of members to be removed from group (empty if unchanged) * addAdmins : String array of members granted admin privileges (empty if unchanged) * removeAdmins : String array of members denied admin privileges (empty if unchanged) * resetGroupLink : Boolean (true = change the group link, false or empty = don't change) * groupLinkState : String ("enabled", "enabled-with-approval", "disabled") (empty if unchanged) * addMemberPermission : String of who may add members ("every-member", "only-admins") (empty if unchanged) * editDetailsPermission : String of who may edit group details ("every-member", "only-admins") (empty if unchanged) * avatar : Filename of avatar picture to be set for group (send the name of an empty file to delete avatar; leave field empty if avatar is unchanged) * expiration : Expiration time for messages sent to this number (in seconds). Set to 0 to disable. (empty if unchanged) Exceptions: AttachmentInvalid, Failure, InvalidNumber, GroupNotFound updateProfile(name, about, aboutEmoji , avatar, remove) -> <>:: updateProfile(givenName, familyName, about, aboutEmoji , avatar, remove) -> <>:: * name : Name for your own profile (empty if unchanged) * givenName : Given name for your own profile (empty if unchanged) * familyName : Family name for your own profile (empty if unchanged) * about : About message for profile (empty if unchanged) * aboutEmoji : Emoji for profile (empty if unchanged) * avatar : Filename of avatar picture for profile (empty if unchanged) * remove : Set to true if the existing avatar picture should be removed Exceptions: Failure setContactBlocked(number, block) -> <>:: * number : Phone number affected by method * block : false=remove block, true=block contact Messages from blocked numbers will no longer be forwarded via DBus. Exceptions: InvalidNumber setGroupBlocked(groupId, block) -> <>:: setGroupBlocked(base64GroupId, block) -> <>:: * groupId : Byte array representing the internal group identifier * base64GroupId : String representing the internal group identifier in Base64 format * block : false=remove block , true=block contact Messages from blocked groups will no longer be forwarded via DBus. Exceptions: GroupNotFound joinGroup(inviteURI) -> <>:: * inviteURI : String starting with https://signal.group which is generated when you share a group link via Signal App Exceptions: Failure quitGroup(groupId) -> <>:: quitGroup(base64GroupId) -> <>:: * groupId : Byte array representing the internal group identifier * base64GroupId : String representing the internal group identifier in Base64 format Note that quitting a group will not remove the group from the getGroupIds command, but set it inactive which can be tested with isMember() Exceptions: GroupNotFound, Failure isMember(groupId) -> active:: isMember(base64GroupId) -> active:: * groupId : Byte array representing the internal group identifier * base64GroupId : String representing the internal group identifier in Base64 format * active : Boolean representing whether you are a member of the group Note that this method does not raise an Exception for a non-existing/unknown group but will simply return false sendEndSessionMessage(recipients) -> <>:: * recipients : String array of phone numbers Exceptions: Failure, InvalidNumber, UntrustedIdentity sendGroupMessage(message, attachments, groupId) -> timestamp:: sendGroupMessage(message, attachments, base64GroupId) -> timestamp:: * message : Text to send (can be UTF8) * attachments : String array of filenames or URLs to send as attachments * groupId : Byte array representing the internal group identifier * base64GroupId : String representing the internal group identifier in Base64 format * timestamp : Can be used to identify the corresponding signal reply Exceptions: GroupNotFound, Failure, AttachmentInvalid sendNoteToSelfMessage(message, attachments) -> timestamp:: * message : Text to send (can be UTF8) * attachments : String array of filenames or URLs to send as attachments * timestamp : Can be used to identify the corresponding signal reply Exceptions: Failure, AttachmentInvalid sendMessage(message, attachments, recipient) -> timestamp:: sendMessage(message, attachments, recipients) -> timestamp:: * message : Text to send (can be UTF8) * attachments : String array of filenames or URLs to send as attachments * recipient : Phone number of a single recipient represented as string * recipients : String array of phone numbers * timestamp : Can be used to identify the corresponding signal reply Depending on the type of the recipient field this sends a message to one or multiple recipients. Exceptions: AttachmentInvalid, Failure, InvalidNumber, UntrustedIdentity sendGroupMessageReaction(emoji, remove, targetAuthor, targetSentTimestamp, groupId) -> timestamp:: sendGroupMessageReaction(emoji, remove, targetAuthor, targetSentTimestamp, base64GroupId) -> timestamp:: * emoji : Unicode grapheme cluster of the emoji * remove : Boolean, whether a previously sent reaction (emoji) should be removed * targetAuthor : String with the phone number of the author of the message to which to react * targetSentTimestamp : Long representing timestamp of the message to which to react * groupId : Byte array with base64 encoded group identifier * base64GroupId : String representing the internal group identifier in Base64 format * timestamp : Long, can be used to identify the corresponding signal reply Exceptions: Failure, InvalidNumber, GroupNotFound sendMessageReaction(emoji, remove, targetAuthor, targetSentTimestamp, recipient) -> timestamp:: sendMessageReaction(emoji, remove, targetAuthor, targetSentTimestamp, recipients) -> timestamp:: * emoji : Unicode grapheme cluster of the emoji * remove : Boolean, whether a previously sent reaction (emoji) should be removed * targetAuthor : String with the phone number of the author of the message to which to react * targetSentTimestamp : Long representing timestamp of the message to which to react * recipient : String with the phone number of a single recipient * recipients : Array of strings with phone numbers, should there be more recipients * timestamp : Long, can be used to identify the corresponding signal reply Depending on the type of the recipient(s) field this sends a reaction to one or multiple recipients. Exceptions: Failure, InvalidNumber sendGroupRemoteDeleteMessage(targetSentTimestamp, groupId) -> timestamp:: sendGroupRemoteDeleteMessage(targetSentTimestamp, base64GroupId) -> timestamp:: * targetSentTimestamp : Long representing timestamp of the message to delete * groupId : Byte array representing the internal group identifier * base64GroupId : String representing the internal group identifier in Base64 format * timestamp : Long, can be used to identify the corresponding signal reply Exceptions: Failure, GroupNotFound sendRemoteDeleteMessage(targetSentTimestamp, recipient) -> timestamp:: sendRemoteDeleteMessage(targetSentTimestamp, recipients) -> timestamp:: * targetSentTimestamp : Long representing timestamp of the message to delete * recipient : String with the phone number of a single recipient * recipients : Array of strings with phone numbers, should there be more recipients * timestamp : Long, can be used to identify the corresponding signal reply Depending on the type of the recipient(s) field this deletes a message with one or multiple recipients. Exceptions: Failure, InvalidNumber sendContacts() -> <> Sends a synchronization message with the local contacts list to all linked devices. Exceptions: Failure, UntrustedIdentity sendSyncRequest() -> <> Sends a synchronization request to the primary device (for group, contacts, ...). Only works if a secondary device is running the daemon. Exception: Failure trust(number, safetyNumber) -> <>:: * number : Phone number * safetyNumber : Verify the safety number associated with the phone number. Exceptions: Failure, InvalidNumber; sendTyping(typingAction, base64GroupId, recipients) -> <> * typingAction : true = start typing, false = stop typing * base64GroupId : String representing the internal group identifier in Base64 format * recipients : List of phone numbers Note that you must specify either the base64GroupId or the list of recipients, but not both. Exceptions: Failure, UntrustedIdentity getContactName(number) -> name:: * number : Phone number * name : Contact's name in local storage (from the primary device for a linked account, or the one set with setContactName); if not set, contact's profile name is used setContactName(number,name<>) -> <>:: * number : Phone number * name : Name to be set in contacts (in local storage with signal-cli) setExpirationTimer(number,expiration) -> <>:: * number : Phone number * expiration : Expiration time for messages sent to this number (in seconds). Set to 0 to disable. getGroupIds() -> groupList:: getGroupIds(dummy) -> groupList:: dummy : any string (ignored by method; forces output to be identical with getBase64GroupIds) groupList : Array of Byte arrays representing the internal group identifiers base64GroupList : Array of strings representing the internal group identifiers in Base64 format All groups known are returned, regardless of their active or blocked status. To query that use isMember() and isGroupBlocked() getBase64GroupIds() -> groupList:: groupList : Array of strings representing the internal group identifiers in Base64 format All groups known are returned, regardless of their active or blocked status. To query that use isMember() and isGroupBlocked() getGroupName(groupId) -> groupName:: getGroupName(base64GroupId) -> groupName:: groupName : The display name of the group groupId : Byte array representing the internal group identifier base64GroupId : String representing the internal group identifier in Base64 format Exceptions: None, if the group name is not found an empty string is returned getGroupMembers(groupId) -> members:: getGroupMembers(base64GroupId) -> members:: members : String array with the phone numbers of all active members of a group groupId : Byte array representing the internal group identifier base64GroupId : String representing the internal group identifier in Base64 format Exceptions: None, if the group name is not found an empty array is returned listNumbers() -> numbers:: numbers : String array of all known numbers This is a concatenated list of all defined contacts as well of profiles known (e.g. peer group members or sender of received messages) getContactNumber(name) -> numbers:: * numbers : Array of phone numbers * name : Contact or profile name ("firstname lastname") 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. isContactBlocked(number) -> state:: * number : Phone number * state : true=blocked, false=not blocked Exceptions: None, for unknown numbers false is returned isGroupBlocked(groupId) -> state:: isGroupBlocked(base64GroupId) -> state:: * groupId : Byte array representing the internal group identifier * base64GroupId : String representing the internal group identifier in Base64 format * state : true=blocked, false=not blocked Exceptions: None, for unknown groups false is returned version() -> version:: * version : Version string of signal-cli isRegistered(number) -> result:: isRegistered(numbers) -> results:: * number : Phone number * numbers : String array of phone numbers * result : true=number is registered, false=number is not registered * results : Boolean array of results listIdentity(number) -> results:: * number : Phone number * results : Array of elements, each consisting of four strings: trust_level, date_added, fingerprint, safety_number ** trust_level : String representation of trust level ** date_added : String representation of date added ** fingerprint : String representation of hexidecimal fingerprint ** safety_number : String representation of safety number (10 or 11 space-separated six-digit numbers) getObjectPath() -> objectPath:: * objectPath : The DBus object path associated with this connection updateAccount() -> <> Updates the account attributes on the Signal server. getObjectPath() -> objectPath:: * objectPath : The DBus object path associated with this connection version() -> version:: * version : Version string of signal-cli link() -> deviceLinkUri:: link(newDeviceName) -> deviceLinkUri:: * newDeviceName : Name to give new device (defaults to "cli" if no name is given) * deviceLinkUri : URI of newly linked device addDevice(deviceUri) -> <>:: * deviceUri : URI in the form of tsdevice:/?uuid=... Normally received from Signal desktop or smartphone app listDevices() -> devices:: * devices : String array of linked devices removeDevice(deviceId) -> <>:: * deviceId : Device ID to remove, obtained from listDevices() command register(number, voiceVerification) -> <>:: * number : Phone number * voiceVerification : true = use voice verification; false = use SMS verification registerWithCaptcha(number, voiceVerification, captcha) -> <>:: * number : Phone number * voiceVerification : true = use voice verification; false = use SMS verification * captcha : Captcha string setPin(pin) -> <>:: * pin : PIN you set after registration (resets after 7 days of inactivity) Sets a registration lock PIN, to prevent others from registering your number. removePin() -> <>:: Removes registration PIN protection. verify(number, verificationCode) -> <> * number : Phone number * verificationCode : Code received from Signal after successful registration request Command fails if PIN was set after previous registration; use verifyWithPin instead. verifyWithPin(number, verificationCode, pin) -> <> * number : Phone number * verificationCode : Code received from Signal after successful registration request * pin : PIN you set with setPin command after verifying previous registration == Signals SyncMessageReceived (timestamp, sender, destination, groupId, message, attachments):: The sync message is received when the user sends a message from a linked device. * timestamp : Integer value that is used by the system to send a ReceiptReceived reply * sender : Phone number of the sender * destination : UUID (legacy identifier) of the destination * groupId : Byte array representing the internal group identifier (empty when private message) * message : Message text * 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 MessageReceived(timestamp, sender, groupId, message, attachments):: * timestamp : Integer value that is used by the system to send a ReceiptReceived reply * sender : Phone number of the sender * groupId : Byte array representing the internal group identifier (empty when private message) * message : Message text * 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 This signal is received whenever we get a private message or a message is posted in a group we are an active member SyncMessageReceivedV2 (timestamp, sender, destination, groupId, message, mentions, attachments):: * timestamp : Integer value that is used by the system to send a ReceiptReceived reply * sender : Phone number of the sender * destination : UUID (legacy identifier) of the destination * groupId : Byte array representing the internal group identifier (empty when private message) * message : Message text * mentions : Struct array of mentions: number, position, length ** number : String phone number ** position : Integer starting position of mention within message ** length : Integer length of mention within message * attachments : Struct array of attachment metadata. ** contentType : String representing the MIME type of the attachment ** fileName : String representing file name if given by the Signal servers ** id : String representing remote identifier of attachment. This the name used by signal-cli to store the attachment, and the current user needs to have read access ** size : Long representing size of attachment in bytes ** keyLength : Integer representing key length ** voiceNote : boolean representing whether this attachment is a voice note ** width : Integer representation of width in pixels (0 if not image) ** height : Integer representation of height in pixels (0 if not image) ** caption : String representing photo caption ** blurHash : String representing blur hash The sync message is received when the user sends a message from a linked device. MessageReceivedV2(timestamp, sender, groupId, message, mentions, attachments):: * timestamp : Integer value that is used by the system to send a ReceiptReceived reply * sender : Phone number of the sender * groupId : Byte array representing the internal group identifier (empty when private message) * message : Message text * mentions : Struct array of mentions: number, position, length ** number : String phone number ** position : Integer starting position of mention within message ** length : Integer length of mention within message * attachments : Struct array of attachment metadata. ** contentType : String representing the MIME type of the attachment ** fileName : String representing file name if given by the Signal servers ** id : String representing remote identifier of attachment. This the name used by signal-cli to store the attachment, and the current user needs to have read access ** size : Long representing size of attachment in bytes ** keyLength : Integer representing key length ** voiceNote : boolean representing whether this attachment is a voice note ** width : Integer representation of width in pixels (0 if not image) ** height : Integer representation of height in pixels (0 if not image) ** caption : String representing photo caption ** blurHash : String representing blur hash This signal is received whenever we get a private message or a message is posted in a group we are an active member ReceiptReceived (timestamp, sender):: * timestamp : Integer value that can be used to associate this e.g. with a sendMessage() * sender : Phone number of the sender This signal is sent by each recipient (e.g. each group member) after the message was successfully delivered to the device == Examples Send a text message (without attachment) to a contact:: 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 Send a group message:: 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 Print the group name corresponding to a groupId; the daemon runs on system bus, and was started without an explicit `-u USERNAME`:: 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 == Authors Maintained by AsamK , who is assisted by other open source contributors. For more information about signal-cli development, see .