Skip to main content

Python API client for signal-cli JSON-RPC

Project description

pysignalclijsonrpc - Python API client for signal-cli JSON-RPC

Python client for signal-cli 0.11.5+ native HTTP endpoint for JSON-RPC methods.

Installation

pip install pysignalclijsonrpc

Usage

Initalization

Default

from pysignalclijsonrpc.api import SignalCliJSONRPCApi

signal_cli_rest_api = SignalCliJSONRPCApi(
    endpoint="http://localhost:3000/api/v1/rpc",
    account="+1234567890" # one of your registered signal-cli accounts
)

Basic authentication

from pysignalclijsonrpc.api import SignalCliJSONRPCApi

signal_cli_rest_api = SignalCliJSONRPCApi(
    endpoint="http://localhost:8080/api/v1/rpc",
    account="+1234567890",
    auth=("user", "password")
)

HTTPS w/ self-signed certificates

from pysignalclijsonrpc.api import SignalCliJSONRPCApi

signal_cli_rest_api = SignalCliJSONRPCApi(
    endpoint="https://localhost:8443/api/v1/rpc",
    account="+1234567890",
    verify_ssl=False
)

Send message

Plain text message

signal_cli_rest_api.send_message("Test")

Plain text message w/ attachment from file

signal_cli_rest_api.send_message("Test", filenames=["/tmp/some-image.png"])

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pysignalclijsonrpc-22.11.9.tar.gz (5.2 kB view hashes)

Uploaded Source

Built Distribution

pysignalclijsonrpc-22.11.9-py3-none-any.whl (5.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page