BulkSMS Overview

BulkSMS Overview

BulkSMSModule.

A Julia package to send SMS (Short Message Service) using BulkSMS API (more exactly HTTP to SMS API)

source

Install

Pkg.clone("https://github.com/scls19fr/BulkSMS.jl")

Usage

using BulkSMS: BulkSMSClient, send
using BulkSMS: multiple, shorten

include("config.jl")

client = BulkSMSClient(CONFIG["MSISDN"], CONFIG["USERNAME"], CONFIG["PASSWORD"])
message = "My first message"
# response = send(client, message, msisdn="+336........")

@info "Send '$message'"
response = send(client, message)  # use client MSISDN by default

# Action when long message can be set using:
# response = send(client, message, action_when_long=shorten)  # shorten long message
# response = send(client, message, action_when_long=multiple)  # multiple messages

@info "response: $response"

See examples

API

Public

BulkSMSClient(msisdn, username, password;
        base_url=_DEFAULT_BASE_URL,
        max_message_len=_DEFAULT_MAX_MESSAGE_LEN)

Create a client that can connect to BulkSMS HTTP to SMS API.

source
BulkSMS.sendFunction.
send(client, message_text; msisdn=nothing, action_when_long::ActionWhenLong=shorten)

Send a text message message_text to BulkSMS using HTTP to SMS API with BulkSMSClient client.

source
ActionWhenLong

Enumeration that defines how long message treated

  • shorten: if message is too long, it will be shorten.
  • multiple: if message is too long, several messages will be sent
source

Private

BulkSMSClientException(s)

BulkSMS client exception.

source
BulkSMSResponse(response)

BulkSMS response (from response::Requests.Response).

source
BulkSMS._cropFunction.
_crop(msg, max_len) -> cropped_msg

Crop a message to max_len.

source
BulkSMS._sendFunction.
_send(client, message_text, msisdn)

Send a text message message_text using client.

This is a "low level" function. You should probably use send(...) insted of _send(...)

source

See also