| Title: | Client for the 'SMS Gora' SMS Gateway |
|---|---|
| Description: | Client for the 'SMS Gora' SMS Gateway <https://tekservix.com/smsgora/>, which sends and receives text messages (SMS, Short Message Service) through your own 'Android' phones and SIM cards. Send single, scheduled and bulk messages, check delivery status, read received messages, manage linked phones and event notifications, and verify their signatures. A 'Tekservix' account with 'SMS Gora' and an API key are required. |
| Authors: | Joseph Niyogushimwa [aut, cre], Tekservix [cph, fnd] |
| Maintainer: | Joseph Niyogushimwa <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 1.0.1 |
| Built: | 2026-12-04 20:13:49 UTC |
| Source: | https://github.com/cran/smsgora |
Cancel a queued or scheduled message
smsgora_cancel_message(client, message_id)smsgora_cancel_message(client, message_id)
client |
A client from |
message_id |
Message ID. |
The cancelled message.
## Not run: smsgora_cancel_message(smsgora_client("sgk_your_key"), 1873) ## End(Not run)## Not run: smsgora_cancel_message(smsgora_client("sgk_your_key"), 1873) ## End(Not run)
Create an SMS Gora client
smsgora_client( key = Sys.getenv("SMSGORA_API_KEY"), base_url = "https://tekservix.com/smsgora/api/v1" )smsgora_client( key = Sys.getenv("SMSGORA_API_KEY"), base_url = "https://tekservix.com/smsgora/api/v1" )
key |
Your SMS Gora API key (starts with |
base_url |
API base URL. Change it only for tests or a proxy. |
An object of class smsgora_client, used by every other function.
client <- smsgora_client("sgk_your_key")client <- smsgora_client("sgk_your_key")
Add a webhook
smsgora_create_webhook(client, url, events, device_id = NULL)smsgora_create_webhook(client, url, events, device_id = NULL)
client |
A client from |
url |
HTTPS address that receives the events. |
events |
Character vector of events, e.g. |
device_id |
Optional phone ID to limit the webhook to one phone. |
The new webhook, including its signing secret.
## Not run: smsgora_create_webhook(smsgora_client("sgk_your_key"), "https://example.com/sms-hook", c("sms.received", "sms.failed")) ## End(Not run)## Not run: smsgora_create_webhook(smsgora_client("sgk_your_key"), "https://example.com/sms-hook", c("sms.received", "sms.failed")) ## End(Not run)
Remove a webhook
smsgora_delete_webhook(client, webhook_id)smsgora_delete_webhook(client, webhook_id)
client |
A client from |
webhook_id |
Webhook ID. |
The API confirmation.
## Not run: smsgora_delete_webhook(smsgora_client("sgk_your_key"), 4) ## End(Not run)## Not run: smsgora_delete_webhook(smsgora_client("sgk_your_key"), 4) ## End(Not run)
Get your account
smsgora_get_account(client)smsgora_get_account(client)
client |
A client from |
Your plan, limits and usage.
## Not run: smsgora_get_account(smsgora_client("sgk_your_key")) ## End(Not run)## Not run: smsgora_get_account(smsgora_client("sgk_your_key")) ## End(Not run)
Get a bulk batch
smsgora_get_batch(client, batch_id)smsgora_get_batch(client, batch_id)
client |
A client from |
batch_id |
Batch ID returned by |
The batch and its progress.
## Not run: smsgora_get_batch(smsgora_client("sgk_your_key"), 311) ## End(Not run)## Not run: smsgora_get_batch(smsgora_client("sgk_your_key"), 311) ## End(Not run)
Get one phone
smsgora_get_device(client, device_id)smsgora_get_device(client, device_id)
client |
A client from |
device_id |
Phone ID. |
The phone and its status.
## Not run: smsgora_get_device(smsgora_client("sgk_your_key"), 12) ## End(Not run)## Not run: smsgora_get_device(smsgora_client("sgk_your_key"), 12) ## End(Not run)
Get one message
smsgora_get_message(client, message_id)smsgora_get_message(client, message_id)
client |
A client from |
message_id |
Message ID. |
The message, with its status (queued, dispatched, sent, delivered, failed or cancelled).
## Not run: smsgora_get_message(smsgora_client("sgk_your_key"), 1873) ## End(Not run)## Not run: smsgora_get_message(smsgora_client("sgk_your_key"), 1873) ## End(Not run)
List your linked phones
smsgora_list_devices(client)smsgora_list_devices(client)
client |
A client from |
A list of phones with their status.
## Not run: smsgora_list_devices(smsgora_client("sgk_your_key")) ## End(Not run)## Not run: smsgora_list_devices(smsgora_client("sgk_your_key")) ## End(Not run)
List messages
smsgora_list_messages(client, ...)smsgora_list_messages(client, ...)
client |
A client from |
... |
Filters passed as query parameters: |
A list with the matching messages and paging details.
## Not run: smsgora_list_messages(smsgora_client("sgk_your_key"), status = "failed", limit = 20) ## End(Not run)## Not run: smsgora_list_messages(smsgora_client("sgk_your_key"), status = "failed", limit = 20) ## End(Not run)
List received SMS
smsgora_list_received_sms(client, device_id = NULL, ...)smsgora_list_received_sms(client, device_id = NULL, ...)
client |
A client from |
device_id |
Optional phone ID; all phones when |
... |
Query parameters such as |
A list with the received messages and paging details.
## Not run: smsgora_list_received_sms(smsgora_client("sgk_your_key"), device_id = 12, limit = 10) ## End(Not run)## Not run: smsgora_list_received_sms(smsgora_client("sgk_your_key"), device_id = 12, limit = 10) ## End(Not run)
List your webhooks
smsgora_list_webhooks(client)smsgora_list_webhooks(client)
client |
A client from |
A list of webhooks.
## Not run: smsgora_list_webhooks(smsgora_client("sgk_your_key")) ## End(Not run)## Not run: smsgora_list_webhooks(smsgora_client("sgk_your_key")) ## End(Not run)
Low-level access for endpoints that have no helper of their own.
smsgora_request(client, method, path, body = NULL, query = NULL)smsgora_request(client, method, path, body = NULL, query = NULL)
client |
A client from |
method |
HTTP method, e.g. |
path |
Path after the base URL, e.g. |
body |
Optional list sent as JSON. |
query |
Optional named list of query parameters. |
The data part of the API answer, as a list.
## Not run: client <- smsgora_client("sgk_your_key") smsgora_request(client, "GET", "/account") ## End(Not run)## Not run: client <- smsgora_client("sgk_your_key") smsgora_request(client, "GET", "/account") ## End(Not run)
Bulk sending from one phone, up to 5,000 recipients per call.
smsgora_send_bulk_sms(client, device_id, messages, template = NULL)smsgora_send_bulk_sms(client, device_id, messages, template = NULL)
client |
A client from |
device_id |
ID of the phone to send from. |
messages |
A list of messages; each is a list with |
template |
Optional text used for messages that have no |
A list describing the batch, including its ID.
## Not run: client <- smsgora_client("sgk_your_key") smsgora_send_bulk_sms(client, 12, list( list(recipients = "+250788123456", message = "Hi Alice, your table is ready"), list(recipients = c("+250722000000", "+250733000000")) ), template = "Thank you for visiting us") ## End(Not run)## Not run: client <- smsgora_client("sgk_your_key") smsgora_send_bulk_sms(client, 12, list( list(recipients = "+250788123456", message = "Hi Alice, your table is ready"), list(recipients = c("+250722000000", "+250733000000")) ), template = "Thank you for visiting us") ## End(Not run)
Sends one text to one or more numbers (up to 1,000), from your best online phone or from the phone you choose.
smsgora_send_sms( client, to, message, device_id = NULL, sim_slot = NULL, schedule_at = NULL )smsgora_send_sms( client, to, message, device_id = NULL, sim_slot = NULL, schedule_at = NULL )
client |
A client from |
to |
Character vector of phone numbers in international format. |
message |
The text to send. |
device_id |
Optional ID of the phone to send from. |
sim_slot |
Optional SIM: 0 = SIM 1, 1 = SIM 2. |
schedule_at |
Optional ISO 8601 time to send later. |
A list with the queued message IDs.
## Not run: client <- smsgora_client("sgk_your_key") smsgora_send_sms(client, "+250788123456", "Your order #1042 has shipped.") smsgora_send_sms(client, c("+250788123456", "+250722000000"), "Reminder: appointment tomorrow", device_id = 12, sim_slot = 1, schedule_at = "2026-12-01T08:00:00Z") ## End(Not run)## Not run: client <- smsgora_client("sgk_your_key") smsgora_send_sms(client, "+250788123456", "Your order #1042 has shipped.") smsgora_send_sms(client, c("+250788123456", "+250722000000"), "Reminder: appointment tomorrow", device_id = 12, sim_slot = 1, schedule_at = "2026-12-01T08:00:00Z") ## End(Not run)
Checks the X-SmsGora-Signature header (sha256= followed by the hex
HMAC-SHA256 of the raw request body, keyed with your webhook secret). The
comparison takes the same time whether or not the signature matches.
smsgora_verify_webhook(raw_body, signature, secret)smsgora_verify_webhook(raw_body, signature, secret)
raw_body |
The raw request body, as a string or raw vector, exactly as received. |
signature |
Value of the |
secret |
Your webhook secret. |
TRUE when the signature is valid, otherwise FALSE.
body <- '{"event":"sms.received"}' sig <- "sha256=313fe9b54923f49c8b94d50c5b96fa44f3f5a7ca90ef52fd55afb2bfd3ae8f60" smsgora_verify_webhook(body, sig, "whsec_test")body <- '{"event":"sms.received"}' sig <- "sha256=313fe9b54923f49c8b94d50c5b96fa44f3f5a7ca90ef52fd55afb2bfd3ae8f60" smsgora_verify_webhook(body, sig, "whsec_test")