Getting started with the Signal API
Service page: https://melroselabs.com/landings/signal-api/
Use the RESTful Signal API to send messages to Signal users.
To use this API you must have a Signal API account. You can obtain an account at the above service page.
Authentication
Account credentials can be provided using either by including the system ID and password credentials in the request payload or by using "basic authentication".
Credentials in the request payload
The systemid
and password
fields of the JSON payload in the request contain the account credentials.
POST /signal/message HTTP/1.1
Accept: application/json
Content-Type: application/json
Host: api.melroselabs.com
Content-Length: 100
{"systemid":"abcdef1234","password":"1234567890","destination":"447700123123","text":"Hello world!"}
Basic authentication
Use your SMPP account system ID and password for the REST call basic authentication username
and password
. The username
and password
will be combined to form a base64-encoded string
POST /signal/message HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Basic YWJjZGVmMTIzNDoxMjM0NTY3ODkw
Host: api.melroselabs.com
Content-Length: 52
{"destination":"447700123123","text":"Hello world!"}
Send a message
The destination
and text
fields must be provided as a minimum in your request.
destination
: mobile number of Signal usertext
: the text message to send to the user
See Send message for using REST to send a message with the Signal API.
Examples
Send the "Hello world!" message to a single Signal user (+44770012313) using the Melrose Labs Signal API account with system ID 1234567890 and password 1234567890.
cURL example
curl --request POST \
--url https://api.melroselabs.com/signal/message \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '
{
"systemid": "abcdefgh",
"password": "1234567890",
"destination": "447700123123",
"text": "Hello world!"
}
'
Python example
import requests
url = "https://api.melroselabs.com/signal/message"
payload = {
"systemid": "abcdefgh",
"password": "1234567890",
"destination": "447700123123",
"text": "Hello world!"
}
headers = {
"accept": "application/json",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)
Node.js example
const sdk = require('api')('@melrose-labs/v1.0#1ryfblhdkefup');
sdk.postMessage({
systemid: 'abcdefgh',
password: '1234567890',
destination: '447700123123',
text: 'Hello world!'
})
.then(({ data }) => console.log(data))
.catch(err => console.error(err));