mirror of
https://github.com/bbernhard/signal-cli-rest-api.git
synced 2026-05-25 14:34:22 +00:00
Merge branch 'master' of https://github.com/bbernhard/signal-cli-rest-api
This commit is contained in:
commit
3c1a7d75a9
29
README.md
29
README.md
@ -1,13 +1,13 @@
|
|||||||
# Dockerized signal-cli REST API
|
# Dockerized signal-cli REST API
|
||||||
|
|
||||||
This project creates a small dockerized REST API around signal-cli(https://github.com/AsamK/signal-cli).
|
This project creates a small dockerized REST API around [signal-cli](https://github.com/AsamK/signal-cli).
|
||||||
|
|
||||||
|
|
||||||
At the moment, the following functionality is exposed via REST:
|
At the moment, the following functionality is exposed via REST:
|
||||||
|
|
||||||
* Register a number
|
* Register a number
|
||||||
* Verify the number using the code received via SMS
|
* Verify the number using the code received via SMS
|
||||||
* Send message to multiple recipients
|
* Send message (+ attachment) to multiple recipients
|
||||||
|
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
@ -18,7 +18,7 @@ Sample `docker-compose.yml`file:
|
|||||||
version: "3"
|
version: "3"
|
||||||
services:
|
services:
|
||||||
signal-cli-rest-api:
|
signal-cli-rest-api:
|
||||||
build: "."
|
image: bbernhard/signal-cli-rest-api:latest
|
||||||
ports:
|
ports:
|
||||||
- "8080:8080" #map docker port 8080 to host port 8080.
|
- "8080:8080" #map docker port 8080 to host port 8080.
|
||||||
network_mode: "host"
|
network_mode: "host"
|
||||||
@ -32,25 +32,28 @@ Sample REST API calls:
|
|||||||
* Register a number (with SMS verification)
|
* Register a number (with SMS verification)
|
||||||
```curl -X POST -H "Content-Type: application/json" 'http://127.0.0.1:8080/v1/register/<number>'```
|
```curl -X POST -H "Content-Type: application/json" 'http://127.0.0.1:8080/v1/register/<number>'```
|
||||||
|
|
||||||
e.g:
|
e.g:
|
||||||
```curl -X POST -H "Content-Type: application/json" 'http://127.0.0.1:8080/v1/register/+431212131491291'```
|
|
||||||
|
```curl -X POST -H "Content-Type: application/json" 'http://127.0.0.1:8080/v1/register/+431212131491291'```
|
||||||
|
|
||||||
* Verify the number using the code received via SMS
|
* Verify the number using the code received via SMS
|
||||||
```curl -X POST -H "Content-Type: application/json" 'http://127.0.0.1:8080/v1/register/<number>/verify/<verification code>'```
|
|
||||||
|
|
||||||
e.g:
|
```curl -X POST -H "Content-Type: application/json" 'http://127.0.0.1:8080/v1/register/<number>/verify/<verification code>'```
|
||||||
```curl -X POST -H "Content-Type: application/json" 'http://127.0.0.1:8080/v1/register/+431212131491291/verify/123-456'```
|
|
||||||
|
e.g:
|
||||||
|
|
||||||
|
```curl -X POST -H "Content-Type: application/json" 'http://127.0.0.1:8080/v1/register/+431212131491291/verify/123-456'```
|
||||||
|
|
||||||
* Send message to multiple recipients
|
* Send message to multiple recipients
|
||||||
|
|
||||||
```curl -X POST -H "Content-Type: application/json" -d '{"message": "<message>", "number": "<number>", "recipients": ["<recipient1>", "<recipient2>"]}' 'http://127.0.0.1:8080/v1/send'```
|
```curl -X POST -H "Content-Type: application/json" -d '{"message": "<message>", "number": "<number>", "recipients": ["<recipient1>", "<recipient2>"]}' 'http://127.0.0.1:8080/v1/send'```
|
||||||
|
|
||||||
e.g:
|
e.g:
|
||||||
|
|
||||||
```curl -X POST -H "Content-Type: application/json" -d '{"message": "Hello World!", "number": "+431212131491291", "recipients": ["+4354546464654", "+4912812812121"]}' 'http://127.0.0.1:8080/v1/send'```
|
```curl -X POST -H "Content-Type: application/json" -d '{"message": "Hello World!", "number": "+431212131491291", "recipients": ["+4354546464654", "+4912812812121"]}' 'http://127.0.0.1:8080/v1/send'```
|
||||||
|
|
||||||
* Send a message (+ base64 encoded attachment) to multiple recipients
|
* Send a message (+ base64 encoded attachment) to multiple recipients
|
||||||
|
|
||||||
```curl -X POST -H "Content-Type: application/json" -d '{"message": "<message>", "base64_attachment": "<base64 encoded attachment>", "number": "<number>", "recipients": ["<recipient1>", "<recipient2>"]}' 'http://127.0.0.1:8080/v1/send'```
|
```curl -X POST -H "Content-Type: application/json" -d '{"message": "<message>", "base64_attachment": "<base64 encoded attachment>", "number": "<number>", "recipients": ["<recipient1>", "<recipient2>"]}' 'http://127.0.0.1:8080/v1/send'```
|
||||||
|
|
||||||
In case you need more functionality, please create a pull request!
|
In case you need more functionality, please **create a pull request**
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user